diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2016-09-07 18:19:41 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-21 08:44:41 -0700 |
commit | b829b9439adc12fa4fb33338694e7f1ad40254c1 (patch) | |
tree | b7718c1f6996471f382dd5d8b02c95ab303e37bb /builtin | |
parent | 19e5656345cb308ab689932d64af0858a3a92400 (diff) | |
download | git-b829b9439adc12fa4fb33338694e7f1ad40254c1.tar.gz |
checkout: fix ambiguity check in subdirnd/checkout-disambiguation
The two functions in parse_branchname_arg(), verify_non_filename and
check_filename, need correct prefix in order to reconstruct the paths
and check for their existence. With NULL prefix, they just check paths
at top dir instead.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/checkout.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 1f71d06c0a..53c7284ffd 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -985,7 +985,7 @@ static int parse_branchname_arg(int argc, const char **argv, int recover_with_dwim = dwim_new_local_branch_ok; if (!has_dash_dash && - (check_filename(NULL, arg) || !no_wildcard(arg))) + (check_filename(opts->prefix, arg) || !no_wildcard(arg))) recover_with_dwim = 0; /* * Accept "git checkout foo" and "git checkout foo --" @@ -1046,7 +1046,7 @@ static int parse_branchname_arg(int argc, const char **argv, * it would be extremely annoying. */ if (argc) - verify_non_filename(NULL, arg); + verify_non_filename(opts->prefix, arg); } else { argcount++; argv++; |