summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2014-05-17 19:49:05 (GMT)
committerPat Thoyts <patthoyts@users.sourceforge.net>2014-06-13 18:03:48 (GMT)
commit3decb8e0ac5d951f0a0cf6e604790b471aef22e1 (patch)
treea3b0024c184e065338f50a1dba5f87d7dad43966
parente0db1dd7d4bc87825f0d7d743f1a01b4461a59ff (diff)
downloadgit-3decb8e0ac5d951f0a0cf6e604790b471aef22e1.zip
git-3decb8e0ac5d951f0a0cf6e604790b471aef22e1.tar.gz
git-3decb8e0ac5d951f0a0cf6e604790b471aef22e1.tar.bz2
git-gui: tolerate major version changes when comparing the git version
Since git 2.0.0 starting git gui in a submodule using a gitfile fails with the following error: No working directory ../../../<path> couldn't change working directory to "../../../<path>": no such file or directory This is because "git rev-parse --show-toplevel" is only run when git gui sees a git version of at least 1.7.0 (which is the version in which the --show-toplevel option was introduced). But "package vsatisfies" returns false when the major version changes, which is not what we want here. Fix that for both places where the git version is checked using vsatisfies by appending a '-' to the version number. This tells vsatisfies that a change of the major version is not considered to be a problem, as long as the new major version is larger. This is done for both the place that caused the reported bug and another spot where the git version is tested for another feature. Reported-by: Chris Packham <judge.packham@gmail.com> Reported-by: Yann Dirson <ydirson@free.fr> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
-rwxr-xr-xgit-gui.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-gui.sh b/git-gui.sh
index c69bfb3..b186329 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1283,7 +1283,7 @@ load_config 0
apply_config
# v1.7.0 introduced --show-toplevel to return the canonical work-tree
-if {[package vsatisfies $_git_version 1.7.0]} {
+if {[package vsatisfies $_git_version 1.7.0-]} {
if { [is_Cygwin] } {
catch {set _gitworktree [exec cygpath --windows [git rev-parse --show-toplevel]]}
} else {
@@ -1539,7 +1539,7 @@ proc rescan_stage2 {fd after} {
close $fd
}
- if {[package vsatisfies $::_git_version 1.6.3]} {
+ if {[package vsatisfies $::_git_version 1.6.3-]} {
set ls_others [list --exclude-standard]
} else {
set ls_others [list --exclude-per-directory=.gitignore]