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>
Andrew Wong committed
Oct 2, 2012 at 12:25 UTC
df46eda3887da7c31cbc3f278550fc8ef9d1ba7a
1 file changed
+7
-2
git-gui.sh
+7
-2
@@ -3037,8 +3037,13 @@ blame {
3037
unset is_path
3038
3039
if {$head ne {} && $path eq {}} {
3040
- set path [normalize_relpath $_prefix$head]
3041
- set head {}
3040
+ if {[string index $head 0] eq {/}} {
3041
+ set path [normalize_relpath $head]
3042
+ set head {}
3043
+ } else {
3044
+ set path [normalize_relpath $_prefix$head]
3045
+ set head {}
3046
+ }
3047
}
3048
3049
if {$head eq {}} {