]> git.ipfire.org Git - thirdparty/git.git/commit
reset: disallow using --keep when there are unmerged entries
authorChristian Couder <chriscool@tuxfamily.org>
Tue, 19 Jan 2010 04:26:01 +0000 (05:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 7 Mar 2010 04:06:50 +0000 (20:06 -0800)
commit812d2a3d61b1bbb1931aff2ed6d2a17e939f5bf2
tree8a4b55f654c0b5f9fe4a4ebfd226e79b949df17d
parentab892a19e83edd1cf9a767bc09d3239f72469d05
reset: disallow using --keep when there are unmerged entries

The use case for --keep option is to remove previous commits unrelated
to the current changes in the working tree. So in this use case we are
not supposed to have unmerged entries. This is why it seems safer to
just disallow using --keep when there are unmerged entries.

And this patch changes the error message when --keep was disallowed and
there were some unmerged entries from:

    error: Entry 'file1' would be overwritten by merge. Cannot merge.
    fatal: Could not reset index file to revision 'HEAD^'.

to:

    fatal: Cannot do a keep reset in the middle of a merge.

which is nicer.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-reset.txt
builtin-reset.c
t/t7110-reset-merge.sh
t/t7111-reset-table.sh