Skip to content

Commit d668187

Browse files
committed
Merge pull request #492 from tomyy/issue-490
git-gui: Use /git-bash.exe if available
2 parents 98a7224 + 076a736 commit d668187

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

git-gui/git-gui.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,10 +2667,18 @@ if {![is_bare]} {
26672667
}
26682668
26692669
if {[is_Windows]} {
2670+
# Use /git-bash.exe if available
2671+
set normalized [file normalize $::argv0]
2672+
regsub "/mingw../libexec/git-core/git-gui$" \
2673+
$normalized "/git-bash.exe" cmdLine
2674+
if {$cmdLine != $normalized && [file exists $cmdLine]} {
2675+
set cmdLine [list "Git Bash" $cmdLine &]
2676+
} else {
2677+
set cmdLine [list "Git Bash" bash --login -l &]
2678+
}
26702679
.mbar.repository add command \
26712680
-label [mc "Git Bash"] \
2672-
-command {eval exec [auto_execok start] \
2673-
[list "Git Bash" bash --login -l &]}
2681+
-command {eval exec [auto_execok start] $cmdLine}
26742682
}
26752683
26762684
if {[is_Windows] || ![is_bare]} {

0 commit comments

Comments
 (0)