From 7f82b24e30e487019fcf6b0e86cf5c6f61a482bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Wed, 7 Sep 2016 18:19:39 +0700 Subject: checkout: add some spaces between code and comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/checkout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin') diff --git a/builtin/checkout.c b/builtin/checkout.c index 8672d0724f..1f71d06c0a 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1038,7 +1038,7 @@ static int parse_branchname_arg(int argc, const char **argv, if (!*source_tree) /* case (1): want a tree */ die(_("reference is not a tree: %s"), arg); - if (!has_dash_dash) {/* case (3).(d) -> (1) */ + if (!has_dash_dash) { /* case (3).(d) -> (1) */ /* * Do not complain the most common case * git checkout branch -- cgit v1.2.3 From b829b9439adc12fa4fb33338694e7f1ad40254c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Wed, 7 Sep 2016 18:19:41 +0700 Subject: checkout: fix ambiguity check in subdir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- builtin/checkout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin') 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++; -- cgit v1.2.3