Skip to content

Commit df46eda

Browse files
andrewkwwpatthoyts
authored andcommitted
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 <[email protected]> Signed-off-by: Pat Thoyts <[email protected]>
1 parent e3d06ca commit df46eda

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

git-gui.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,8 +3037,13 @@ blame {
30373037
unset is_path
30383038
30393039
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+
}
30423047
}
30433048
30443049
if {$head eq {}} {

0 commit comments

Comments
 (0)