diff options
author | Jeff King <peff@peff.net> | 2016-02-11 00:12:34 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-11 00:53:18 +0300 |
commit | 1cc777de6f4396f578e0f5e6b1a5ec23b96a52f0 (patch) | |
tree | 1357866eedf4e28e63e89611cc65a2ae3e0a2585 /builtin/checkout.c | |
parent | b3325dfc64017c7b8f982171a084d5d22aad8e14 (diff) |
checkout: reorder check_filename conditional
If we have a "--" flag, we should not be doing DWIM magic
based on whether arguments can be filenames. Reorder the
conditional to avoid the check_filename() call entirely in
this case. The outcome is the same, but the short-circuit
makes the dependency more clear.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 3e141fc149..d34f58eba6 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -965,7 +965,7 @@ static int parse_branchname_arg(int argc, const char **argv, */ int recover_with_dwim = dwim_new_local_branch_ok; - if (check_filename(NULL, arg) && !has_dash_dash) + if (!has_dash_dash && check_filename(NULL, arg)) recover_with_dwim = 0; /* * Accept "git checkout foo" and "git checkout foo --" |