diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-11-10 09:05:31 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-11-10 09:05:31 -0800 |
commit | 77f143bf3e218857ec8e5244d7e862e8e0c1a041 (patch) | |
tree | 9f720e61941241b53a4f258d0dc62e5a9a360aa8 /t/t1000-read-tree-m-3way.sh | |
parent | mktree: fix a memory leak in write_tree() (diff) | |
parent | build-in git-mktree (diff) | |
download | tgif-77f143bf3e218857ec8e5244d7e862e8e0c1a041.tar.xz |
Merge 'build-in git-mktree'
* commit '633e3556ccbc': (5835 commits)
build-in git-mktree
allow -t abbreviation for --track in git branch
gitweb: Remove function prototypes (cleanup)
Documentation: cloning to empty directory is allowed
Clarify kind of conflict in merge-one-file helper
git config: clarify --add and --get-color
archive-tar.c: squelch a type mismatch warning
Start 1.6.4 development
Start 1.6.3.1 maintenance series.
GIT 1.6.3
t4029: use sh instead of bash
t4200: convert sed expression which operates on non-text file to perl
t4200: remove two unnecessary lines
t/annotate-tests.sh: avoid passing a non-newline terminated file to sed
t4118: avoid sed invocation on file without terminating newline
t4118: add missing '&&'
t8005: use egrep when extended regular expressions are required
git-clean doc: the command only affects paths under $(cwd)
improve error message in config.c
t4018-diff-funcname: add cpp xfuncname pattern to syntax test
...
Diffstat (limited to 't/t1000-read-tree-m-3way.sh')
-rwxr-xr-x | t/t1000-read-tree-m-3way.sh | 165 |
1 files changed, 91 insertions, 74 deletions
diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh index 37add1b504..22ba7a5442 100755 --- a/t/t1000-read-tree-m-3way.sh +++ b/t/t1000-read-tree-m-3way.sh @@ -72,7 +72,7 @@ In addition: ' . ./test-lib.sh -. ../lib-read-tree-m-3way.sh +. "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh ################################################################ # Trivial "majority when 3 stages exist" merge plus #2ALT, #3ALT @@ -131,7 +131,7 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" check_result () { git ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current && - git diff expected current + test_cmp expected current } # This is done on an empty work directory, which is the normal @@ -210,12 +210,12 @@ DF (file) when tree B require DF to be a directory by having DF/DF END_OF_CASE_TABLE -test_expect_failure \ - '1 - must not have an entry not in A.' \ - "rm -f .git/index XX && +test_expect_success '1 - must not have an entry not in A.' " + rm -f .git/index XX && echo XX >XX && git update-index --add XX && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '2 - must match B in !O && !A && B case.' \ @@ -248,13 +248,14 @@ test_expect_success \ echo extra >>AN && git read-tree -m $tree_O $tree_A $tree_B" -test_expect_failure \ - '3 (fail) - must match A in !O && A && !B case.' \ - "rm -f .git/index AN && +test_expect_success \ + '3 (fail) - must match A in !O && A && !B case.' " + rm -f .git/index AN && cp .orig-A/AN AN && echo extra >>AN && git update-index --add AN && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '4 - must match and be up-to-date in !O && A && B && A!=B case.' \ @@ -264,21 +265,23 @@ test_expect_success \ git read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' \ - "rm -f .git/index AA && +test_expect_success \ + '4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' " + rm -f .git/index AA && cp .orig-A/AA AA && git update-index --add AA && echo extra >>AA && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" -test_expect_failure \ - '4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' \ - "rm -f .git/index AA && +test_expect_success \ + '4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' " + rm -f .git/index AA && cp .orig-A/AA AA && echo extra >>AA && git update-index --add AA && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '5 - must match in !O && A && B && A==B case.' \ @@ -297,34 +300,38 @@ test_expect_success \ git read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '5 (fail) - must match A in !O && A && B && A==B case.' \ - "rm -f .git/index LL && +test_expect_success \ + '5 (fail) - must match A in !O && A && B && A==B case.' " + rm -f .git/index LL && cp .orig-A/LL LL && echo extra >>LL && git update-index --add LL && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" -test_expect_failure \ - '6 - must not exist in O && !A && !B case' \ - "rm -f .git/index DD && +test_expect_success \ + '6 - must not exist in O && !A && !B case' " + rm -f .git/index DD && echo DD >DD git update-index --add DD && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" -test_expect_failure \ - '7 - must not exist in O && !A && B && O!=B case' \ - "rm -f .git/index DM && +test_expect_success \ + '7 - must not exist in O && !A && B && O!=B case' " + rm -f .git/index DM && cp .orig-B/DM DM && git update-index --add DM && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" -test_expect_failure \ - '8 - must not exist in O && !A && B && O==B case' \ - "rm -f .git/index DN && +test_expect_success \ + '8 - must not exist in O && !A && B && O==B case' " + rm -f .git/index DN && cp .orig-B/DN DN && git update-index --add DN && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '9 - must match and be up-to-date in O && A && !B && O!=A case' \ @@ -334,21 +341,23 @@ test_expect_success \ git read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '9 (fail) - must match and be up-to-date in O && A && !B && O!=A case' \ - "rm -f .git/index MD && +test_expect_success \ + '9 (fail) - must match and be up-to-date in O && A && !B && O!=A case' " + rm -f .git/index MD && cp .orig-A/MD MD && git update-index --add MD && echo extra >>MD && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" -test_expect_failure \ - '9 (fail) - must match and be up-to-date in O && A && !B && O!=A case' \ - "rm -f .git/index MD && +test_expect_success \ + '9 (fail) - must match and be up-to-date in O && A && !B && O!=A case' " + rm -f .git/index MD && cp .orig-A/MD MD && echo extra >>MD && git update-index --add MD && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '10 - must match and be up-to-date in O && A && !B && O==A case' \ @@ -358,21 +367,23 @@ test_expect_success \ git read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '10 (fail) - must match and be up-to-date in O && A && !B && O==A case' \ - "rm -f .git/index ND && +test_expect_success \ + '10 (fail) - must match and be up-to-date in O && A && !B && O==A case' " + rm -f .git/index ND && cp .orig-A/ND ND && git update-index --add ND && echo extra >>ND && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" -test_expect_failure \ - '10 (fail) - must match and be up-to-date in O && A && !B && O==A case' \ - "rm -f .git/index ND && +test_expect_success \ + '10 (fail) - must match and be up-to-date in O && A && !B && O==A case' " + rm -f .git/index ND && cp .orig-A/ND ND && echo extra >>ND && git update-index --add ND && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '11 - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' \ @@ -382,21 +393,23 @@ test_expect_success \ git read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' \ - "rm -f .git/index MM && +test_expect_success \ + '11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' " + rm -f .git/index MM && cp .orig-A/MM MM && git update-index --add MM && echo extra >>MM && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" -test_expect_failure \ - '11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' \ - "rm -f .git/index MM && +test_expect_success \ + '11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' " + rm -f .git/index MM && cp .orig-A/MM MM && echo extra >>MM && git update-index --add MM && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '12 - must match A in O && A && B && O!=A && A==B case' \ @@ -415,13 +428,14 @@ test_expect_success \ git read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '12 (fail) - must match A in O && A && B && O!=A && A==B case' \ - "rm -f .git/index SS && +test_expect_success \ + '12 (fail) - must match A in O && A && B && O!=A && A==B case' " + rm -f .git/index SS && cp .orig-A/SS SS && echo extra >>SS && git update-index --add SS && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '13 - must match A in O && A && B && O!=A && O==B case' \ @@ -457,21 +471,23 @@ test_expect_success \ git read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' \ - "rm -f .git/index NM && +test_expect_success \ + '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' " + rm -f .git/index NM && cp .orig-A/NM NM && git update-index --add NM && echo extra >>NM && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" -test_expect_failure \ - '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' \ - "rm -f .git/index NM && +test_expect_success \ + '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' " + rm -f .git/index NM && cp .orig-A/NM NM && echo extra >>NM && git update-index --add NM && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" test_expect_success \ '15 - must match A in O && A && B && O==A && O==B case' \ @@ -490,13 +506,14 @@ test_expect_success \ git read-tree -m $tree_O $tree_A $tree_B && check_result" -test_expect_failure \ - '15 (fail) - must match A in O && A && B && O==A && O==B case' \ - "rm -f .git/index NN && +test_expect_success \ + '15 (fail) - must match A in O && A && B && O==A && O==B case' " + rm -f .git/index NN && cp .orig-A/NN NN && echo extra >>NN && git update-index --add NN && - git read-tree -m $tree_O $tree_A $tree_B" + test_must_fail git read-tree -m $tree_O $tree_A $tree_B +" # #16 test_expect_success \ |