checkout: fix ambiguity check in subdir
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>
This commit is contained in:

committed by
Junio C Hamano

parent
19e5656345
commit
b829b9439a
@ -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++;
|
||||
|
Reference in New Issue
Block a user