diff options
author | Andrew Wong <andrew.kw.w@gmail.com> | 2012-10-02 12:25:15 -0400 |
---|---|---|
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | 2012-10-17 21:47:50 +0100 |
commit | df46eda3887da7c31cbc3f278550fc8ef9d1ba7a (patch) | |
tree | 920e48024af697afdf43e9504bba12a31a64005f /git-gui.sh | |
parent | git-gui: Detect full path when parsing arguments (diff) | |
download | tgif-df46eda3887da7c31cbc3f278550fc8ef9d1ba7a.tar.xz |
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>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-x | git-gui.sh | 9 |
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 {}} { |