summaryrefslogtreecommitdiff
path: root/t/t7111-reset-table.sh
AgeCommit message (Collapse)AuthorFilesLines
2010-03-06reset: disallow using --keep when there are unmerged entriesLibravatar Christian Couder1-1/+1
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>
2010-01-24reset: add test cases for "--keep" optionLibravatar Christian Couder1-0/+8
This shows that with the "--keep" option, changes that are both in the work tree and the index are kept in the work tree after the reset (but discarded in the index). In the case of unmerged entries, we can see that "git reset --keep" works only when the target state is the same as HEAD. And then the work tree is not reset. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-16t7111: fix bad HEAD in tests with unmerged entriesLibravatar Christian Couder1-10/+10
When testing what happens on unmerged entries, the HEAD is the commit we are starting from before the merge that fails and create the unmerged entries. It is not the commit before. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09t7111: check that reset options work as described in the tablesLibravatar Christian Couder1-0/+113
Some previous patches added some tables to the "git reset" documentation. These tables describe the behavior of "git reset" depending on the option it is passed and the state of the files in the working tree, the index, HEAD and the target commit. This patch adds some tests to make sure that the tables describe the behavior of "git reset". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>