• Christian Couder's avatar
    reset: disallow using --keep when there are unmerged entries · 812d2a3d
    Christian Couder authored
    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^'.
        fatal: Cannot do a keep reset in the middle of a merge.
    which is nicer.
    Signed-off-by: Christian Couder's avatarChristian Couder <chriscool@tuxfamily.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
t7111-reset-table.sh 2.5 KB