Skip to content

Commit 45ab460

Browse files
committed
Merge branch 'js/git-bash-if-available'
git-gui will now use git-bash instead of bash on Windows, if it is available. * js/git-bash-if-available: git-gui (Windows): use git-bash.exe if it is available
2 parents 60c60b6 + 6a72d44 commit 45ab460

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

git-gui.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,10 +2736,18 @@ if {![is_bare]} {
27362736
}
27372737
27382738
if {[is_Windows]} {
2739+
# Use /git-bash.exe if available
2740+
set normalized [file normalize $::argv0]
2741+
regsub "/mingw../libexec/git-core/git-gui$" \
2742+
$normalized "/git-bash.exe" cmdLine
2743+
if {$cmdLine != $normalized && [file exists $cmdLine]} {
2744+
set cmdLine [list "Git Bash" $cmdLine &]
2745+
} else {
2746+
set cmdLine [list "Git Bash" bash --login -l &]
2747+
}
27392748
.mbar.repository add command \
27402749
-label [mc "Git Bash"] \
2741-
-command {eval exec [auto_execok start] \
2742-
[list "Git Bash" bash --login -l &]}
2750+
-command {eval exec [auto_execok start] $cmdLine}
27432751
}
27442752
27452753
if {[is_Windows] || ![is_bare]} {

0 commit comments

Comments
 (0)