Skip to content

Commit a08832f

Browse files
committed
Merge branch 'rs/rebase-commit-validation' into maint
Diagnose command line error of "git rebase" early. * rs/rebase-commit-validation: rebase: verify commit parameter
2 parents 9536d1b + ca5120c commit a08832f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtin/rebase.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
19171917
die_if_checked_out(buf.buf, 1);
19181918
options.head_name = xstrdup(buf.buf);
19191919
/* If not is it a valid ref (branch or commit)? */
1920-
} else if (!get_oid(branch_name, &options.orig_head))
1920+
} else if (!get_oid(branch_name, &options.orig_head) &&
1921+
lookup_commit_reference(the_repository,
1922+
&options.orig_head))
19211923
options.head_name = NULL;
19221924
else
19231925
die(_("fatal: no such branch/commit '%s'"),

0 commit comments

Comments
 (0)