aboutsummaryrefslogtreecommitdiff
path: root/t/t1008-read-tree-overlay.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2011-05-25 22:10:41 +0200
committerJunio C Hamano <gitster@pobox.com>2011-05-25 15:04:25 -0700
commitea5070c91f23e41a88dec48d2f8d96444c2d647a (patch)
tree02f08913add0b41a67d3369b5abc015bfe6e1133 /t/t1008-read-tree-overlay.sh
parent2c9078d05bf2200c9671e0b292638d42e7e4fd71 (diff)
downloadgit-ea5070c91f23e41a88dec48d2f8d96444c2d647a.tar.gz
git-ea5070c91f23e41a88dec48d2f8d96444c2d647a.tar.xz
Teach read-tree the -n|--dry-run option
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>
Diffstat (limited to 't/t1008-read-tree-overlay.sh')
-rwxr-xr-xt/t1008-read-tree-overlay.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t1008-read-tree-overlay.sh b/t/t1008-read-tree-overlay.sh
index f9e00285d..4c50ed955 100755
--- a/t/t1008-read-tree-overlay.sh
+++ b/t/t1008-read-tree-overlay.sh
@@ -3,6 +3,7 @@
test_description='test multi-tree read-tree without merging'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-read-tree.sh
test_expect_success setup '
echo one >a &&
@@ -21,7 +22,7 @@ test_expect_success setup '
'
test_expect_success 'multi-read' '
- git read-tree initial master side &&
+ read_tree_must_succeed initial master side &&
(echo a; echo b/c) >expect &&
git ls-files >actual &&
test_cmp expect actual