diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-01-15 23:20:29 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-15 23:20:29 (GMT) |
commit | df26861c564b96e88330bc22fa7410b5ead686d9 (patch) | |
tree | edb2c71758ebb8ea2d10e7894256144d2bbfd901 /builtin/rebase.c | |
parent | 8b327f1784d21c52bc177b5ca75665db388d6367 (diff) | |
parent | ca5120c339de883c3f22161316416c91655651ab (diff) | |
download | git-df26861c564b96e88330bc22fa7410b5ead686d9.zip git-df26861c564b96e88330bc22fa7410b5ead686d9.tar.gz git-df26861c564b96e88330bc22fa7410b5ead686d9.tar.bz2 |
Merge branch 'rs/rebase-commit-validation'
Diagnose command line error of "git rebase" early.
* rs/rebase-commit-validation:
rebase: verify commit parameter
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r-- | builtin/rebase.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c index 19c7b37..840dbd7 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1917,7 +1917,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) die_if_checked_out(buf.buf, 1); options.head_name = xstrdup(buf.buf); /* If not is it a valid ref (branch or commit)? */ - } else if (!get_oid(branch_name, &options.orig_head)) + } else if (!get_oid(branch_name, &options.orig_head) && + lookup_commit_reference(the_repository, + &options.orig_head)) options.head_name = NULL; else die(_("fatal: no such branch/commit '%s'"), |