diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2008-08-21 14:14:18 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-21 23:37:38 -0700 |
commit | 4be636f42cd75f865204817c307eb1a7b464109c (patch) | |
tree | 98b775fd6b8a72e4d5f7f4de21f1461ffaa71794 /builtin-merge.c | |
parent | ea360dd0538d03d25f512efe2f100beb3e7c2130 (diff) | |
download | git-4be636f42cd75f865204817c307eb1a7b464109c.tar.gz git-4be636f42cd75f865204817c307eb1a7b464109c.tar.xz |
provide more errors for the "merge into empty head" case
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>
Diffstat (limited to 'builtin-merge.c')
-rw-r--r-- | builtin-merge.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin-merge.c b/builtin-merge.c index a201c6628..7759a0b1e 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -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]); |