From df46eda3887da7c31cbc3f278550fc8ef9d1ba7a Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Tue, 2 Oct 2012 12:25:15 -0400 Subject: [PATCH] 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 --- git-gui.sh | 9 +++++++-- 1 file 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 {}} { -- 2.11.4.GIT