提交 e3d06ca9 编写于 作者: A Andrew Wong 提交者: Pat Thoyts

git-gui: Detect full path when parsing arguments

When running "git-gui blame" from a subfolder (which means prefix is
non-empty), if we pass a full path as argument, the argument parsing
will fail to recognize the argument as a file name, because prefix is
prepended to the argument.

This patch handles that scenario by adding an additional branch that
checks the file name without using the prefix.
Signed-off-by: NAndrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: NPat Thoyts <patthoyts@users.sourceforge.net>
上级 5a5e4d25
......@@ -3003,10 +3003,19 @@ blame {
set jump_spec {}
set is_path 0
foreach a $argv {
if {$is_path || [file exists $_prefix$a]} {
if {[file exists $a]} {
if {$path ne {}} usage
set path [normalize_relpath $a]
break
} elseif {[file exists $_prefix$a]} {
if {$path ne {}} usage
set path [normalize_relpath $_prefix$a]
break
}
if {$is_path} {
if {$path ne {}} usage
break
} elseif {$a eq {--}} {
if {$path ne {}} {
if {$head ne {}} usage
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册