From: Andrew Wong Date: Tue, 2 Oct 2012 16:25:15 +0000 (-0400) Subject: git-gui: Don't prepend the prefix if value looks like a full path X-Git-Tag: gitgui-0.17.0~1 X-Git-Url: https://repo.or.cz/w/git-gui.git/commitdiff_plain/df46eda3887da7c31cbc3f278550fc8ef9d1ba7a 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 Signed-off-by: Pat Thoyts --- diff --git a/git-gui.sh b/git-gui.sh index 5d7894b..89f636f 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 {}} {