mirror of
https://github.com/git/git
synced 2024-08-29 04:29:22 +00:00
![Jens Lehmann](/assets/img/avatar_default.png)
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>
33 lines
584 B
Bash
Executable file
33 lines
584 B
Bash
Executable file
#!/bin/sh
|
|
|
|
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 &&
|
|
git add a &&
|
|
git commit -m initial &&
|
|
git tag initial &&
|
|
echo two >b &&
|
|
git add b &&
|
|
git commit -m second &&
|
|
git checkout -b side initial &&
|
|
echo three >a &&
|
|
mkdir b &&
|
|
echo four >b/c &&
|
|
git add b/c &&
|
|
git commit -m third
|
|
'
|
|
|
|
test_expect_success 'multi-read' '
|
|
read_tree_must_succeed initial master side &&
|
|
(echo a; echo b/c) >expect &&
|
|
git ls-files >actual &&
|
|
test_cmp expect actual
|
|
'
|
|
|
|
test_done
|
|
|