summaryrefslogtreecommitdiff
path: root/t/t1005-read-tree-reset.sh
AgeCommit message (Collapse)AuthorFilesLines
2018-07-16t1000-t1999: fix broken &&-chainsLibravatar Eric Sunshine1-5/+5
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-04t1005: add test for "read-tree --reset -u A B"Libravatar Junio C Hamano1-0/+15
With a conflicted index, this used to give us an error. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-04t1005: reindentLibravatar Junio C Hamano1-63/+63
Just to update the style of this ancient test script to match our house style. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-25Teach read-tree the -n|--dry-run optionLibravatar Jens Lehmann1-6/+7
The option can be used to check if read-tree with the same set of other options like "-m" and "-u" would succeed without actually changing either the index or the working tree. The relevant tests in the t10?? range were extended to do a read-tree -n before the real read-tree to make sure neither the index nor any local files were changed with -n and the same exit code as without -n is returned. The helper functions added for that purpose reside in the new t/lib-read-tree.sh file. The only exception is #13 in t1004 ("unlinking an un-unlink-able symlink"). As this is an issue of wrong directory permissions it is not detected with -n. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-18reset --hard/read-tree --reset -u: remove unmerged new pathsLibravatar Junio C Hamano1-0/+60
When aborting a failed merge that has brought in a new path using "git reset --hard" or "git read-tree --reset -u", we used to first forget about the new path (via read_cache_unmerged) and then matched the working tree to what is recorded in the index, thus ending up leaving the new path in the work tree. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13add test_cmp function for test scriptsLibravatar Jeff King1-1/+1
Many scripts compare actual and expected output using "diff -u". This is nicer than "cmp" because the output shows how the two differ. However, not all versions of diff understand -u, leading to unnecessary test failure. This adds a test_cmp function to the test scripts and switches all "diff -u" invocations to use it. The function uses the contents of "$GIT_TEST_CMP" to compare its arguments; the default is "diff -u". On systems with a less-capable diff, you can do: GIT_TEST_CMP=cmp make test Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-09Make 'unpack_trees()' have a separate source and destination indexLibravatar Linus Torvalds1-1/+1
We will always unpack into our own internal index, but we will take the source from wherever specified, and we will optionally write the result to a specified index (optionally, because not everybody even _wants_ any result: the index diffing really wants to just walk the tree and index in parallel). This ends up removing a fair number more lines than it adds, for the simple reason that we can now skip all the crud that tried to be oh-so-careful about maintaining our position in the index as we were traversing and modifying it. Since we don't actually modify the source index any more, we can just update the 'o->pos' pointer without worrying about whether an index entry got removed or replaced or added to. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-08Add a test for read-tree -u --reset with a D/F conflictLibravatar Jeff King1-0/+30
Signed-off-by: Junio C Hamano <gitster@pobox.com>