Skip to content

Commit

Permalink
provide more errors for the "merge into empty head" case
Browse files Browse the repository at this point in the history
A squash merge into an unborn branch could be implemented by building the
index from the merged-from branch, and doing a single commit, but this is
not supported yet.

A non-fast-forward merge into an unborn branch does not make any sense,
because you cannot make a merge commit if you don't have a commit to use
as the parent.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Paolo Bonzini authored and Junio C Hamano committed Aug 22, 2008
1 parent ea360dd commit 4be636f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
if (argc != 1)
die("Can merge only exactly one commit into "
"empty head");
if (squash)
die("Squash commit into empty head not supported yet");
if (!allow_fast_forward)
die("Non-fast-forward commit does not make sense into "
"an empty head");
remote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT);
if (!remote_head)
die("%s - not something we can merge", argv[0]);
Expand Down

0 comments on commit 4be636f

Please sign in to comment.