summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Wong <andrew.kw.w@gmail.com>2012-10-02 12:25:15 -0400
committerPat Thoyts <patthoyts@users.sourceforge.net>2012-10-17 21:47:50 +0100
commitdf46eda3887da7c31cbc3f278550fc8ef9d1ba7a (patch)
tree920e48024af697afdf43e9504bba12a31a64005f
parente3d06ca93eebaf5e4bf8438255a30fb6c91ab277 (diff)
downloadgit-df46eda3887da7c31cbc3f278550fc8ef9d1ba7a.tar.gz
git-gui: Don't prepend the prefix if value looks like a full path
When argument parsing fails to detect a file name, "git-gui" will try to use the previously detected "head" as the file name. We should avoid prepending the prefix if "head" looks like a full path. Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
-rwxr-xr-xgit-gui.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 5d7894bd94..89f636f496 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3037,8 +3037,13 @@ blame {
unset is_path
if {$head ne {} && $path eq {}} {
- set path [normalize_relpath $_prefix$head]
- set head {}
+ if {[string index $head 0] eq {/}} {
+ set path [normalize_relpath $head]
+ set head {}
+ } else {
+ set path [normalize_relpath $_prefix$head]
+ set head {}
+ }
}
if {$head eq {}} {