diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-06-02 13:35:04 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-02 13:35:04 -0700 |
commit | de82fb45db72fb425fd5d4af81955e48349c2816 (patch) | |
tree | 881482ed79847d8b6af1f8d6df0c44aa96fa2679 /builtin | |
parent | Merge branch 'lo/sparse-universal-zero-init' (diff) | |
parent | checkout: improve error messages for -b with extra argument (diff) | |
download | tgif-de82fb45db72fb425fd5d4af81955e48349c2816.tar.xz |
Merge branch 'rs/checkout-b-track-error'
The error message from "git checkout -b foo -t bar baz" was
confusing.
* rs/checkout-b-track-error:
checkout: improve error messages for -b with extra argument
checkout: add tests for -b and --track
Diffstat (limited to 'builtin')
-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 e9d111bb83..24336e1017 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1689,7 +1689,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix, * Try to give more helpful suggestion. * new_branch && argc > 1 will be caught later. */ - if (opts->new_branch && argc == 1) + if (opts->new_branch && argc == 1 && !new_branch_info.commit) die(_("'%s' is not a commit and a branch '%s' cannot be created from it"), argv[0], opts->new_branch); |