author | Johannes Sixt <johannes.sixt@telecom.at> | |
Mon, 3 Dec 2007 07:24:50 +0000 (08:24 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Dec 2007 08:25:26 +0000 (00:25 -0800) | ||
commit | 13aba1e514c1dceee9d731d157bbc261426be351 | |
tree | 212234441c9d52a3112e1ba67cda3a7b2435f858 | tree | snapshot |
parent | afcc4f7767ad8a2daac1c816fad02c890b0d2b99 | commit | diff |
git-commit: Allow to amend a merge commit that does not change the tree
Normally, it should not be allowed to generate an empty commit. A merge
commit generated with git 'merge -s ours' does not change the tree (along
the first parent), but merges are not "empty" even if they do not change
the tree. Hence, commit 8588452ceb7 allowed to amend a merge commit that
does not change the tree, but 4fb5fd5d301 disallowed it again in an
attempt to avoid that an existing commit is amended such that it becomes
empty. With this change, a commit can be edited (create a new one or amend
an existing one) either if there are changes or if there are at least two
parents.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Normally, it should not be allowed to generate an empty commit. A merge
commit generated with git 'merge -s ours' does not change the tree (along
the first parent), but merges are not "empty" even if they do not change
the tree. Hence, commit 8588452ceb7 allowed to amend a merge commit that
does not change the tree, but 4fb5fd5d301 disallowed it again in an
attempt to avoid that an existing commit is amended such that it becomes
empty. With this change, a commit can be edited (create a new one or amend
an existing one) either if there are changes or if there are at least two
parents.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-commit.sh | diff | blob | history | |
t/t7501-commit.sh | diff | blob | history |