git-gui: corrected setup of git worktree under cygwin.
Under cygwin the _gitworktree variable needs to contain the Windows style path string so the output provided by git rev-parse must be converted from cygwin path style to native. Reviewed-by: Jesse Welch <jesse.welch@baml.com> Signed-off-by: John Patrick Murphy <john.murphy@baml.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
John Murphy committed
Sep 4, 2013 at 11:03 UTC
4394faf6e53e8b91c82332aa4f2b77616350a81b
1 file changed
+5
-1
git-gui.sh
+5
-1
@@ -1284,7 +1284,11 @@ apply_config
1284
1285
# v1.7.0 introduced --show-toplevel to return the canonical work-tree
1286
if {[package vsatisfies $_git_version 1.7.0]} {
1287
- set _gitworktree [git rev-parse --show-toplevel]
1287
+ if { [is_Cygwin] } {
1288
+ catch {set _gitworktree [exec cygpath --windows [git rev-parse --show-toplevel]]}
1289
+ } else {
1290
+ set _gitworktree [git rev-parse --show-toplevel]
1291
+ }
1292
} else {
1293
# try to set work tree from environment, core.worktree or use
1294
# cdup to obtain a relative path to the top of the worktree. If