Merge branch 'es/test-fixes'

Test clean-up and corrections.

* es/test-fixes: (26 commits)
  t5608: fix broken &&-chain
  t9119: fix broken &&-chains
  t9000-t9999: fix broken &&-chains
  t7000-t7999: fix broken &&-chains
  t6000-t6999: fix broken &&-chains
  t5000-t5999: fix broken &&-chains
  t4000-t4999: fix broken &&-chains
  t3030: fix broken &&-chains
  t3000-t3999: fix broken &&-chains
  t2000-t2999: fix broken &&-chains
  t1000-t1999: fix broken &&-chains
  t0000-t0999: fix broken &&-chains
  t9814: simplify convoluted check that command correctly errors out
  t9001: fix broken "invoke hook" test
  t7810: use test_expect_code() instead of hand-rolled comparison
  t7400: fix broken "submodule add/reconfigure --force" test
  t7201: drop pointless "exit 0" at end of subshell
  t6036: fix broken "merge fails but has appropriate contents" tests
  t5505: modernize and simplify hard-to-digest test
  t5406: use write_script() instead of birthing shell script manually
  ...
This commit is contained in:
Junio C Hamano 2018-08-02 15:30:40 -07:00
commit 7a135475d3
104 changed files with 569 additions and 590 deletions

View File

@ -756,7 +756,7 @@ test_submodule_recursing_with_args_common() {
: >sub1/untrackedfile && : >sub1/untrackedfile &&
test_must_fail $command replace_sub1_with_file && test_must_fail $command replace_sub1_with_file &&
test_superproject_content origin/add_sub1 && test_superproject_content origin/add_sub1 &&
test_submodule_content sub1 origin/add_sub1 test_submodule_content sub1 origin/add_sub1 &&
test -f sub1/untracked_file test -f sub1/untracked_file
) )
' '
@ -844,7 +844,7 @@ test_submodule_switch_recursing_with_args () {
cd submodule_update && cd submodule_update &&
git branch -t add_sub1 origin/add_sub1 && git branch -t add_sub1 origin/add_sub1 &&
: >sub1 && : >sub1 &&
echo sub1 >.git/info/exclude echo sub1 >.git/info/exclude &&
$command add_sub1 && $command add_sub1 &&
test_superproject_content origin/add_sub1 && test_superproject_content origin/add_sub1 &&
test_submodule_content sub1 origin/add_sub1 test_submodule_content sub1 origin/add_sub1
@ -971,7 +971,6 @@ test_submodule_forced_switch_recursing_with_args () {
rm -rf .git/modules/sub1 && rm -rf .git/modules/sub1 &&
$command replace_sub1_with_directory && $command replace_sub1_with_directory &&
test_superproject_content origin/replace_sub1_with_directory && test_superproject_content origin/replace_sub1_with_directory &&
test_submodule_content sub1 origin/modify_sub1
test_git_directory_exists sub1 test_git_directory_exists sub1
) )
' '

View File

@ -1081,7 +1081,7 @@ test_expect_success 'very long name in the index handled sanely' '
( (
git ls-files -s path4 | git ls-files -s path4 |
sed -e "s/ .*/ /" | sed -e "s/ .*/ /" |
tr -d "\012" tr -d "\012" &&
echo "$a" echo "$a"
) | git update-index --index-info && ) | git update-index --index-info &&
len=$(git ls-files "a*" | wc -c) && len=$(git ls-files "a*" | wc -c) &&

View File

@ -408,7 +408,7 @@ is_hidden () {
test_expect_success MINGW '.git hidden' ' test_expect_success MINGW '.git hidden' '
rm -rf newdir && rm -rf newdir &&
( (
unset GIT_DIR GIT_WORK_TREE sane_unset GIT_DIR GIT_WORK_TREE &&
mkdir newdir && mkdir newdir &&
cd newdir && cd newdir &&
git init && git init &&
@ -420,7 +420,7 @@ test_expect_success MINGW '.git hidden' '
test_expect_success MINGW 'bare git dir not hidden' ' test_expect_success MINGW 'bare git dir not hidden' '
rm -rf newdir && rm -rf newdir &&
( (
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&
mkdir newdir && mkdir newdir &&
cd newdir && cd newdir &&
git --bare init git --bare init

View File

@ -34,15 +34,15 @@ test_expect_success 'open-quoted pathname' '
test_expect_success 'setup' ' test_expect_success 'setup' '
mkdir -p a/b/d a/c b && mkdir -p a/b/d a/c b &&
( (
echo "[attr]notest !test" echo "[attr]notest !test" &&
echo "\" d \" test=d" echo "\" d \" test=d" &&
echo " e test=e" echo " e test=e" &&
echo " e\" test=e" echo " e\" test=e" &&
echo "f test=f" echo "f test=f" &&
echo "a/i test=a/i" echo "a/i test=a/i" &&
echo "onoff test -test" echo "onoff test -test" &&
echo "offon -test test" echo "offon -test test" &&
echo "no notest" echo "no notest" &&
echo "A/e/F test=A/e/F" echo "A/e/F test=A/e/F"
) >.gitattributes && ) >.gitattributes &&
( (
@ -51,7 +51,7 @@ test_expect_success 'setup' '
) >a/.gitattributes && ) >a/.gitattributes &&
( (
echo "h test=a/b/h" && echo "h test=a/b/h" &&
echo "d/* test=a/b/d/*" echo "d/* test=a/b/d/*" &&
echo "d/yes notest" echo "d/yes notest"
) >a/b/.gitattributes && ) >a/b/.gitattributes &&
( (
@ -287,7 +287,7 @@ test_expect_success 'bare repository: check that .gitattribute is ignored' '
( (
cd bare.git && cd bare.git &&
( (
echo "f test=f" echo "f test=f" &&
echo "a/i test=a/i" echo "a/i test=a/i"
) >.gitattributes && ) >.gitattributes &&
attr_check f unspecified && attr_check f unspecified &&
@ -312,7 +312,7 @@ test_expect_success 'bare repository: test info/attributes' '
( (
cd bare.git && cd bare.git &&
( (
echo "f test=f" echo "f test=f" &&
echo "a/i test=a/i" echo "a/i test=a/i"
) >info/attributes && ) >info/attributes &&
attr_check f f && attr_check f f &&

View File

@ -785,7 +785,7 @@ test_expect_success PERL 'missing file in delayed checkout' '
cd repo && cd repo &&
git init && git init &&
echo "*.a filter=bug" >.gitattributes && echo "*.a filter=bug" >.gitattributes &&
cp "$TEST_ROOT/test.o" missing-delay.a cp "$TEST_ROOT/test.o" missing-delay.a &&
git add . && git add . &&
git commit -m "test commit" git commit -m "test commit"
) && ) &&
@ -807,7 +807,7 @@ test_expect_success PERL 'invalid file in delayed checkout' '
git init && git init &&
echo "*.a filter=bug" >.gitattributes && echo "*.a filter=bug" >.gitattributes &&
cp "$TEST_ROOT/test.o" invalid-delay.a && cp "$TEST_ROOT/test.o" invalid-delay.a &&
cp "$TEST_ROOT/test.o" unfiltered cp "$TEST_ROOT/test.o" unfiltered &&
git add . && git add . &&
git commit -m "test commit" git commit -m "test commit"
) && ) &&

View File

@ -156,7 +156,7 @@ test_expect_success PERL 'commit --interactive gives cache-tree on partial commi
return 44; return 44;
} }
EOT EOT
(echo p; echo 1; echo; echo s; echo n; echo y; echo q) | test_write_lines p 1 "" s n y q |
git commit --interactive -m foo && git commit --interactive -m foo &&
test_cache_tree test_cache_tree
' '

View File

@ -210,10 +210,10 @@ test_expect_success 'D/F' '
read_tree_u_must_succeed -m -u branch-point side-b side-a && read_tree_u_must_succeed -m -u branch-point side-b side-a &&
git ls-files -u >actual && git ls-files -u >actual &&
( (
a=$(git rev-parse branch-point:subdir/file2) a=$(git rev-parse branch-point:subdir/file2) &&
b=$(git rev-parse side-a:subdir/file2/another) b=$(git rev-parse side-a:subdir/file2/another) &&
echo "100644 $a 1 subdir/file2" echo "100644 $a 1 subdir/file2" &&
echo "100644 $a 2 subdir/file2" echo "100644 $a 2 subdir/file2" &&
echo "100644 $b 3 subdir/file2/another" echo "100644 $b 3 subdir/file2/another"
) >expect && ) >expect &&
test_cmp expect actual test_cmp expect actual

View File

@ -33,7 +33,7 @@ test_expect_success 'reset should remove remnants from a failed merge' '
git ls-files -s >expect && git ls-files -s >expect &&
sha1=$(git rev-parse :new) && sha1=$(git rev-parse :new) &&
( (
echo "100644 $sha1 1 old" echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old" echo "100644 $sha1 3 old"
) | git update-index --index-info && ) | git update-index --index-info &&
>old && >old &&
@ -48,7 +48,7 @@ test_expect_success 'two-way reset should remove remnants too' '
git ls-files -s >expect && git ls-files -s >expect &&
sha1=$(git rev-parse :new) && sha1=$(git rev-parse :new) &&
( (
echo "100644 $sha1 1 old" echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old" echo "100644 $sha1 3 old"
) | git update-index --index-info && ) | git update-index --index-info &&
>old && >old &&
@ -63,7 +63,7 @@ test_expect_success 'Porcelain reset should remove remnants too' '
git ls-files -s >expect && git ls-files -s >expect &&
sha1=$(git rev-parse :new) && sha1=$(git rev-parse :new) &&
( (
echo "100644 $sha1 1 old" echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old" echo "100644 $sha1 3 old"
) | git update-index --index-info && ) | git update-index --index-info &&
>old && >old &&
@ -78,7 +78,7 @@ test_expect_success 'Porcelain checkout -f should remove remnants too' '
git ls-files -s >expect && git ls-files -s >expect &&
sha1=$(git rev-parse :new) && sha1=$(git rev-parse :new) &&
( (
echo "100644 $sha1 1 old" echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old" echo "100644 $sha1 3 old"
) | git update-index --index-info && ) | git update-index --index-info &&
>old && >old &&
@ -93,7 +93,7 @@ test_expect_success 'Porcelain checkout -f HEAD should remove remnants too' '
git ls-files -s >expect && git ls-files -s >expect &&
sha1=$(git rev-parse :new) && sha1=$(git rev-parse :new) &&
( (
echo "100644 $sha1 1 old" echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old" echo "100644 $sha1 3 old"
) | git update-index --index-info && ) | git update-index --index-info &&
>old && >old &&

View File

@ -23,7 +23,7 @@ test_expect_success setup '
test_expect_success 'multi-read' ' test_expect_success 'multi-read' '
read_tree_must_succeed initial master side && read_tree_must_succeed initial master side &&
(echo a; echo b/c) >expect && test_write_lines a b/c >expect &&
git ls-files >actual && git ls-files >actual &&
test_cmp expect actual test_cmp expect actual
' '

View File

@ -148,7 +148,7 @@ test_expect_success 'GIT_PREFIX for built-ins' '
( (
cd dir && cd dir &&
echo "change" >two && echo "change" >two &&
GIT_EXTERNAL_DIFF=./diff git diff >../actual GIT_EXTERNAL_DIFF=./diff git diff >../actual &&
git checkout -- two git checkout -- two
) && ) &&
test_cmp expect actual test_cmp expect actual

View File

@ -108,7 +108,7 @@ test_expect_success 'packsize limit' '
test-tool genrandom "c" $(( 128 * 1024 )) >mid3 && test-tool genrandom "c" $(( 128 * 1024 )) >mid3 &&
git add mid1 mid2 mid3 && git add mid1 mid2 mid3 &&
count=0 count=0 &&
for pi in .git/objects/pack/pack-*.idx for pi in .git/objects/pack/pack-*.idx
do do
test -f "$pi" && count=$(( $count + 1 )) test -f "$pi" && count=$(( $count + 1 ))
@ -116,8 +116,8 @@ test_expect_success 'packsize limit' '
test $count = 2 && test $count = 2 &&
( (
git hash-object --stdin <mid1 git hash-object --stdin <mid1 &&
git hash-object --stdin <mid2 git hash-object --stdin <mid2 &&
git hash-object --stdin <mid3 git hash-object --stdin <mid3
) | ) |
sort >expect && sort >expect &&

View File

@ -888,7 +888,7 @@ EOF
test_expect_success !MINGW 'get --path copes with unset $HOME' ' test_expect_success !MINGW 'get --path copes with unset $HOME' '
( (
unset HOME; sane_unset HOME &&
test_must_fail git config --get --path path.home \ test_must_fail git config --get --path path.home \
>result 2>msg && >result 2>msg &&
git config --get --path path.normal >>result && git config --get --path path.normal >>result &&

View File

@ -159,9 +159,9 @@ test_expect_success 'git log -g -p shows diffs vs. parents' '
git log -1 -p HEAD^ >log.one && git log -1 -p HEAD^ >log.one &&
git log -1 -p HEAD >log.two && git log -1 -p HEAD >log.two &&
( (
cat log.one; echo cat log.one && echo &&
cat log.two; echo cat log.two && echo &&
cat log.one; echo cat log.one && echo &&
cat log.two cat log.two
) >expect && ) >expect &&
test_cmp expect actual test_cmp expect actual

View File

@ -123,9 +123,9 @@ test_expect_success 'checkout -b new my-side@{u} forks from the same' '
test_expect_success 'merge my-side@{u} records the correct name' ' test_expect_success 'merge my-side@{u} records the correct name' '
( (
cd clone || exit cd clone &&
git checkout master || exit git checkout master &&
git branch -D new ;# can fail but is ok test_might_fail git branch -D new &&
git branch -t new my-side@{u} && git branch -t new my-side@{u} &&
git merge -s ours new@{u} && git merge -s ours new@{u} &&
git show -s --pretty=tformat:%s >actual && git show -s --pretty=tformat:%s >actual &&

View File

@ -34,8 +34,8 @@ test_expect_success 'blob and tree' '
for i in 0 1 2 3 4 5 6 7 8 9 for i in 0 1 2 3 4 5 6 7 8 9
do do
echo $i echo $i
done done &&
echo echo &&
echo b1rwzyc3 echo b1rwzyc3
) >a0blgqsjc && ) >a0blgqsjc &&
@ -222,7 +222,7 @@ test_expect_success 'more history' '
test_might_fail git rm -f a0blgqsjc && test_might_fail git rm -f a0blgqsjc &&
( (
git cat-file blob $side:f5518nwu git cat-file blob $side:f5518nwu &&
echo j3l0i9s6 echo j3l0i9s6
) >ab2gs879 && ) >ab2gs879 &&
git add ab2gs879 && git add ab2gs879 &&

View File

@ -435,7 +435,7 @@ test_expect_success 'writing split index with null sha1 does not write cache tre
commit=$(git commit-tree $tree -p HEAD <msg) && commit=$(git commit-tree $tree -p HEAD <msg) &&
git update-ref HEAD "$commit" && git update-ref HEAD "$commit" &&
GIT_ALLOW_NULL_SHA1=1 git reset --hard && GIT_ALLOW_NULL_SHA1=1 git reset --hard &&
(test-tool dump-cache-tree >cache-tree.out || true) && test_might_fail test-tool dump-cache-tree >cache-tree.out &&
test_line_count = 0 cache-tree.out test_line_count = 0 cache-tree.out
' '

View File

@ -20,33 +20,33 @@ test_expect_success PERL 'setup' '
test_expect_success PERL 'saying "n" does nothing' ' test_expect_success PERL 'saying "n" does nothing' '
set_and_save_state dir/foo work head && set_and_save_state dir/foo work head &&
(echo n; echo n) | git checkout -p && test_write_lines n n | git checkout -p &&
verify_saved_state bar && verify_saved_state bar &&
verify_saved_state dir/foo verify_saved_state dir/foo
' '
test_expect_success PERL 'git checkout -p' ' test_expect_success PERL 'git checkout -p' '
(echo n; echo y) | git checkout -p && test_write_lines n y | git checkout -p &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo head head verify_state dir/foo head head
' '
test_expect_success PERL 'git checkout -p with staged changes' ' test_expect_success PERL 'git checkout -p with staged changes' '
set_state dir/foo work index && set_state dir/foo work index &&
(echo n; echo y) | git checkout -p && test_write_lines n y | git checkout -p &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo index index verify_state dir/foo index index
' '
test_expect_success PERL 'git checkout -p HEAD with NO staged changes: abort' ' test_expect_success PERL 'git checkout -p HEAD with NO staged changes: abort' '
set_and_save_state dir/foo work head && set_and_save_state dir/foo work head &&
(echo n; echo y; echo n) | git checkout -p HEAD && test_write_lines n y n | git checkout -p HEAD &&
verify_saved_state bar && verify_saved_state bar &&
verify_saved_state dir/foo verify_saved_state dir/foo
' '
test_expect_success PERL 'git checkout -p HEAD with NO staged changes: apply' ' test_expect_success PERL 'git checkout -p HEAD with NO staged changes: apply' '
(echo n; echo y; echo y) | git checkout -p HEAD && test_write_lines n y y | git checkout -p HEAD &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo head head verify_state dir/foo head head
' '
@ -54,14 +54,14 @@ test_expect_success PERL 'git checkout -p HEAD with NO staged changes: apply' '
test_expect_success PERL 'git checkout -p HEAD with change already staged' ' test_expect_success PERL 'git checkout -p HEAD with change already staged' '
set_state dir/foo index index && set_state dir/foo index index &&
# the third n is to get out in case it mistakenly does not apply # the third n is to get out in case it mistakenly does not apply
(echo n; echo y; echo n) | git checkout -p HEAD && test_write_lines n y n | git checkout -p HEAD &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo head head verify_state dir/foo head head
' '
test_expect_success PERL 'git checkout -p HEAD^' ' test_expect_success PERL 'git checkout -p HEAD^' '
# the third n is to get out in case it mistakenly does not apply # the third n is to get out in case it mistakenly does not apply
(echo n; echo y; echo n) | git checkout -p HEAD^ && test_write_lines n y n | git checkout -p HEAD^ &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo parent parent verify_state dir/foo parent parent
' '
@ -69,7 +69,7 @@ test_expect_success PERL 'git checkout -p HEAD^' '
test_expect_success PERL 'git checkout -p handles deletion' ' test_expect_success PERL 'git checkout -p handles deletion' '
set_state dir/foo work index && set_state dir/foo work index &&
rm dir/foo && rm dir/foo &&
(echo n; echo y) | git checkout -p && test_write_lines n y | git checkout -p &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo index index verify_state dir/foo index index
' '
@ -81,21 +81,21 @@ test_expect_success PERL 'git checkout -p handles deletion' '
test_expect_success PERL 'path limiting works: dir' ' test_expect_success PERL 'path limiting works: dir' '
set_state dir/foo work head && set_state dir/foo work head &&
(echo y; echo n) | git checkout -p dir && test_write_lines y n | git checkout -p dir &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo head head verify_state dir/foo head head
' '
test_expect_success PERL 'path limiting works: -- dir' ' test_expect_success PERL 'path limiting works: -- dir' '
set_state dir/foo work head && set_state dir/foo work head &&
(echo y; echo n) | git checkout -p -- dir && test_write_lines y n | git checkout -p -- dir &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo head head verify_state dir/foo head head
' '
test_expect_success PERL 'path limiting works: HEAD^ -- dir' ' test_expect_success PERL 'path limiting works: HEAD^ -- dir' '
# the third n is to get out in case it mistakenly does not apply # the third n is to get out in case it mistakenly does not apply
(echo y; echo n; echo n) | git checkout -p HEAD^ -- dir && test_write_lines y n n | git checkout -p HEAD^ -- dir &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo parent parent verify_state dir/foo parent parent
' '
@ -103,7 +103,7 @@ test_expect_success PERL 'path limiting works: HEAD^ -- dir' '
test_expect_success PERL 'path limiting works: foo inside dir' ' test_expect_success PERL 'path limiting works: foo inside dir' '
set_state dir/foo work head && set_state dir/foo work head &&
# the third n is to get out in case it mistakenly does not apply # the third n is to get out in case it mistakenly does not apply
(echo y; echo n; echo n) | (cd dir && git checkout -p foo) && test_write_lines y n n | (cd dir && git checkout -p foo) &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo head head verify_state dir/foo head head
' '

View File

@ -32,7 +32,7 @@ test_expect_success basics '
test_create_repo xyzzy && test_create_repo xyzzy &&
cd xyzzy && cd xyzzy &&
>file && >file &&
git add file git add file &&
git commit -m "sub initial" git commit -m "sub initial"
) && ) &&
git add xyzzy && git add xyzzy &&

View File

@ -6,12 +6,12 @@ test_description='git add --all'
test_expect_success setup ' test_expect_success setup '
( (
echo .gitignore echo .gitignore &&
echo will-remove echo will-remove
) >expect && ) >expect &&
( (
echo actual echo actual &&
echo expect echo expect &&
echo ignored echo ignored
) >.gitignore && ) >.gitignore &&
git --literal-pathspecs add --all && git --literal-pathspecs add --all &&
@ -25,10 +25,10 @@ test_expect_success setup '
test_expect_success 'git add --all' ' test_expect_success 'git add --all' '
( (
echo .gitignore echo .gitignore &&
echo not-ignored echo not-ignored &&
echo "M .gitignore" echo "M .gitignore" &&
echo "A not-ignored" echo "A not-ignored" &&
echo "D will-remove" echo "D will-remove"
) >expect && ) >expect &&
>ignored && >ignored &&

View File

@ -84,7 +84,7 @@ test_expect_success SYMLINKS 'ls-files --others with symlinked submodule' '
) && ) &&
( (
cd super && cd super &&
"$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" ../sub sub "$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" ../sub sub &&
git ls-files --others --exclude-standard >../actual git ls-files --others --exclude-standard >../actual
) && ) &&
echo sub/ >expect && echo sub/ >expect &&

View File

@ -29,7 +29,7 @@ test_expect_success 'overly-long path does not replace another by mistake' '
printf "$pat" "$blob_a" "$path_a" "$blob_z" "$path_z" | printf "$pat" "$blob_a" "$path_a" "$blob_z" "$path_z" |
git update-index --add --index-info && git update-index --add --index-info &&
( (
echo "$path_a" echo "$path_a" &&
echo "$path_z" echo "$path_z"
) >expect && ) >expect &&
git ls-files >actual && git ls-files >actual &&

View File

@ -14,10 +14,10 @@ LAZY_THREAD_COST=2000
test_expect_success 'no buffer overflow in lazy_init_name_hash' ' test_expect_success 'no buffer overflow in lazy_init_name_hash' '
( (
test_seq $LAZY_THREAD_COST | sed "s/^/a_/" test_seq $LAZY_THREAD_COST | sed "s/^/a_/" &&
echo b/b/b echo b/b/b &&
test_seq $LAZY_THREAD_COST | sed "s/^/c_/" test_seq $LAZY_THREAD_COST | sed "s/^/c_/" &&
test_seq 50 | sed "s/^/d_/" | tr "\n" "/"; echo d test_seq 50 | sed "s/^/d_/" | tr "\n" "/" && echo d
) | ) |
sed "s/^/100644 $EMPTY_BLOB /" | sed "s/^/100644 $EMPTY_BLOB /" |
git update-index --index-info && git update-index --index-info &&

View File

@ -36,15 +36,15 @@ test_expect_success 'setup 1' '
test_tick && test_tick &&
git commit -m "master modifies a and d/e" && git commit -m "master modifies a and d/e" &&
c1=$(git rev-parse --verify HEAD) && c1=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o1 a" echo "100644 blob $o1 a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o1 d/e" echo "100644 blob $o1 d/e" &&
echo "100644 $o1 0 a" echo "100644 $o1 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -54,15 +54,15 @@ test_expect_success 'setup 2' '
rm -rf [abcd] && rm -rf [abcd] &&
git checkout side && git checkout side &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o0 a" echo "100644 blob $o0 a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o0 0 a" echo "100644 $o0 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
@ -75,15 +75,15 @@ test_expect_success 'setup 2' '
test_tick && test_tick &&
git commit -m "side modifies a" && git commit -m "side modifies a" &&
c2=$(git rev-parse --verify HEAD) && c2=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o2 a" echo "100644 blob $o2 a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o2 0 a" echo "100644 $o2 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -93,15 +93,15 @@ test_expect_success 'setup 3' '
rm -rf [abcd] && rm -rf [abcd] &&
git checkout df-1 && git checkout df-1 &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o0 a" echo "100644 blob $o0 a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o0 0 a" echo "100644 $o0 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
@ -112,15 +112,15 @@ test_expect_success 'setup 3' '
test_tick && test_tick &&
git commit -m "df-1 makes b/c" && git commit -m "df-1 makes b/c" &&
c3=$(git rev-parse --verify HEAD) && c3=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o0 a" echo "100644 blob $o0 a" &&
echo "100644 blob $o3 b/c" echo "100644 blob $o3 b/c" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o0 0 a" echo "100644 $o0 0 a" &&
echo "100644 $o3 0 b/c" echo "100644 $o3 0 b/c" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -130,15 +130,15 @@ test_expect_success 'setup 4' '
rm -rf [abcd] && rm -rf [abcd] &&
git checkout df-2 && git checkout df-2 &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o0 a" echo "100644 blob $o0 a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o0 0 a" echo "100644 $o0 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
@ -149,15 +149,15 @@ test_expect_success 'setup 4' '
test_tick && test_tick &&
git commit -m "df-2 makes a/c" && git commit -m "df-2 makes a/c" &&
c4=$(git rev-parse --verify HEAD) && c4=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o4 a/c" echo "100644 blob $o4 a/c" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o4 0 a/c" echo "100644 $o4 0 a/c" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -167,15 +167,15 @@ test_expect_success 'setup 5' '
rm -rf [abcd] && rm -rf [abcd] &&
git checkout remove && git checkout remove &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o0 a" echo "100644 blob $o0 a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o0 0 a" echo "100644 $o0 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
@ -190,13 +190,13 @@ test_expect_success 'setup 5' '
test_tick && test_tick &&
git commit -m "remove removes b and modifies a" && git commit -m "remove removes b and modifies a" &&
c5=$(git rev-parse --verify HEAD) && c5=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o5 a" echo "100644 blob $o5 a" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o5 0 a" echo "100644 $o5 0 a" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -207,15 +207,15 @@ test_expect_success 'setup 6' '
rm -rf [abcd] && rm -rf [abcd] &&
git checkout df-3 && git checkout df-3 &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o0 a" echo "100644 blob $o0 a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 $o0 0 a" echo "100644 $o0 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
@ -226,15 +226,15 @@ test_expect_success 'setup 6' '
test_tick && test_tick &&
git commit -m "df-3 makes d" && git commit -m "df-3 makes d" &&
c6=$(git rev-parse --verify HEAD) && c6=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o0 a" echo "100644 blob $o0 a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o6 d" echo "100644 blob $o6 d" &&
echo "100644 $o0 0 a" echo "100644 $o0 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o6 0 d" echo "100644 $o6 0 d"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -286,11 +286,11 @@ test_expect_success 'merge-recursive result' '
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o0 1 a" echo "100644 $o0 1 a" &&
echo "100644 $o2 2 a" echo "100644 $o2 2 a" &&
echo "100644 $o1 3 a" echo "100644 $o1 3 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -325,10 +325,10 @@ test_expect_success 'merge-recursive remove conflict' '
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o0 1 a" echo "100644 $o0 1 a" &&
echo "100644 $o1 2 a" echo "100644 $o1 2 a" &&
echo "100644 $o5 3 a" echo "100644 $o5 3 a" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -347,9 +347,9 @@ test_expect_success 'merge-recursive result' '
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 a" echo "100644 $o1 0 a" &&
echo "100644 $o3 0 b/c" echo "100644 $o3 0 b/c" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -369,11 +369,11 @@ test_expect_success 'merge-recursive d/f conflict result' '
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o0 1 a" echo "100644 $o0 1 a" &&
echo "100644 $o1 2 a" echo "100644 $o1 2 a" &&
echo "100644 $o4 0 a/c" echo "100644 $o4 0 a/c" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -393,11 +393,11 @@ test_expect_success 'merge-recursive d/f conflict result the other way' '
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o0 1 a" echo "100644 $o0 1 a" &&
echo "100644 $o1 3 a" echo "100644 $o1 3 a" &&
echo "100644 $o4 0 a/c" echo "100644 $o4 0 a/c" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -417,11 +417,11 @@ test_expect_success 'merge-recursive d/f conflict result' '
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 a" echo "100644 $o1 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o6 3 d" echo "100644 $o6 3 d" &&
echo "100644 $o0 1 d/e" echo "100644 $o0 1 d/e" &&
echo "100644 $o1 2 d/e" echo "100644 $o1 2 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -441,11 +441,11 @@ test_expect_success 'merge-recursive d/f conflict result' '
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 a" echo "100644 $o1 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o6 2 d" echo "100644 $o6 2 d" &&
echo "100644 $o0 1 d/e" echo "100644 $o0 1 d/e" &&
echo "100644 $o1 3 d/e" echo "100644 $o1 3 d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -465,13 +465,13 @@ test_expect_success 'reset and bind merge' '
git read-tree --prefix=M/ master && git read-tree --prefix=M/ master &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 M/a" echo "100644 $o1 0 M/a" &&
echo "100644 $o0 0 M/b" echo "100644 $o0 0 M/b" &&
echo "100644 $o0 0 M/c" echo "100644 $o0 0 M/c" &&
echo "100644 $o1 0 M/d/e" echo "100644 $o1 0 M/d/e" &&
echo "100644 $o1 0 a" echo "100644 $o1 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
@ -479,17 +479,17 @@ test_expect_success 'reset and bind merge' '
git read-tree --prefix=a1/ master && git read-tree --prefix=a1/ master &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 M/a" echo "100644 $o1 0 M/a" &&
echo "100644 $o0 0 M/b" echo "100644 $o0 0 M/b" &&
echo "100644 $o0 0 M/c" echo "100644 $o0 0 M/c" &&
echo "100644 $o1 0 M/d/e" echo "100644 $o1 0 M/d/e" &&
echo "100644 $o1 0 a" echo "100644 $o1 0 a" &&
echo "100644 $o1 0 a1/a" echo "100644 $o1 0 a1/a" &&
echo "100644 $o0 0 a1/b" echo "100644 $o0 0 a1/b" &&
echo "100644 $o0 0 a1/c" echo "100644 $o0 0 a1/c" &&
echo "100644 $o1 0 a1/d/e" echo "100644 $o1 0 a1/d/e" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e"
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
@ -497,21 +497,21 @@ test_expect_success 'reset and bind merge' '
git read-tree --prefix=z/ master && git read-tree --prefix=z/ master &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 M/a" echo "100644 $o1 0 M/a" &&
echo "100644 $o0 0 M/b" echo "100644 $o0 0 M/b" &&
echo "100644 $o0 0 M/c" echo "100644 $o0 0 M/c" &&
echo "100644 $o1 0 M/d/e" echo "100644 $o1 0 M/d/e" &&
echo "100644 $o1 0 a" echo "100644 $o1 0 a" &&
echo "100644 $o1 0 a1/a" echo "100644 $o1 0 a1/a" &&
echo "100644 $o0 0 a1/b" echo "100644 $o0 0 a1/b" &&
echo "100644 $o0 0 a1/c" echo "100644 $o0 0 a1/c" &&
echo "100644 $o1 0 a1/d/e" echo "100644 $o1 0 a1/d/e" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o1 0 d/e" echo "100644 $o1 0 d/e" &&
echo "100644 $o1 0 z/a" echo "100644 $o1 0 z/a" &&
echo "100644 $o0 0 z/b" echo "100644 $o0 0 z/b" &&
echo "100644 $o0 0 z/c" echo "100644 $o0 0 z/c" &&
echo "100644 $o1 0 z/d/e" echo "100644 $o1 0 z/d/e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -589,8 +589,8 @@ test_expect_success 'merge-recursive simple w/submodule result' '
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o5 0 a" echo "100644 $o5 0 a" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "160000 $c1 0 d" echo "160000 $c1 0 d"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -601,13 +601,13 @@ test_expect_success 'merge-recursive copy vs. rename' '
git merge rename && git merge rename &&
( git ls-tree -r HEAD && git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 blob $o0 e" echo "100644 blob $o0 e" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e" &&
echo "100644 $o0 0 e" echo "100644 $o0 0 e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -617,17 +617,17 @@ test_expect_failure 'merge-recursive rename vs. rename/symlink' '
git checkout -f rename && git checkout -f rename &&
git merge rename-ln && git merge rename-ln &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
echo "120000 blob $oln a" echo "120000 blob $oln a" &&
echo "100644 blob $o0 b" echo "100644 blob $o0 b" &&
echo "100644 blob $o0 c" echo "100644 blob $o0 c" &&
echo "100644 blob $o0 d/e" echo "100644 blob $o0 d/e" &&
echo "100644 blob $o0 e" echo "100644 blob $o0 e" &&
echo "120000 $oln 0 a" echo "120000 $oln 0 a" &&
echo "100644 $o0 0 b" echo "100644 $o0 0 b" &&
echo "100644 $o0 0 c" echo "100644 $o0 0 c" &&
echo "100644 $o0 0 d/e" echo "100644 $o0 0 d/e" &&
echo "100644 $o0 0 e" echo "100644 $o0 0 e"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual

View File

@ -21,10 +21,10 @@ test_expect_success setup '
test_expect_success clone ' test_expect_success clone '
git clone "file://$(pwd)/.git" cloned && git clone "file://$(pwd)/.git" cloned &&
(git rev-parse HEAD; git ls-files -s) >expected && (git rev-parse HEAD && git ls-files -s) >expected &&
( (
cd cloned && cd cloned &&
(git rev-parse HEAD; git ls-files -s) >../actual (git rev-parse HEAD && git ls-files -s) >../actual
) && ) &&
test_cmp expected actual test_cmp expected actual
' '
@ -40,11 +40,11 @@ test_expect_success advance '
' '
test_expect_success fetch ' test_expect_success fetch '
(git rev-parse HEAD; git ls-files -s) >expected && (git rev-parse HEAD && git ls-files -s) >expected &&
( (
cd cloned && cd cloned &&
git pull && git pull &&
(git rev-parse HEAD; git ls-files -s) >../actual (git rev-parse HEAD && git ls-files -s) >../actual
) && ) &&
test_cmp expected actual test_cmp expected actual
' '

View File

@ -23,7 +23,7 @@ test_expect_success 'ls-tree outside prefix' '
cat >expect <<-EOF && cat >expect <<-EOF &&
100644 blob $EMPTY_BLOB ../a[a]/three 100644 blob $EMPTY_BLOB ../a[a]/three
EOF EOF
( cd aa && git ls-tree -r HEAD "../a[a]"; ) >actual && ( cd aa && git ls-tree -r HEAD "../a[a]" ) >actual &&
test_cmp expect actual test_cmp expect actual
' '

View File

@ -231,9 +231,9 @@ test_expect_success 'timeout if packed-refs.lock exists' '
test_expect_success 'retry acquiring packed-refs.lock' ' test_expect_success 'retry acquiring packed-refs.lock' '
LOCK=.git/packed-refs.lock && LOCK=.git/packed-refs.lock &&
>"$LOCK" && >"$LOCK" &&
test_when_finished "wait; rm -f $LOCK" && test_when_finished "wait && rm -f $LOCK" &&
{ {
( sleep 1 ; rm -f $LOCK ) & ( sleep 1 && rm -f $LOCK ) &
} && } &&
git -c core.packedrefstimeout=3000 pack-refs --all --prune git -c core.packedrefstimeout=3000 pack-refs --all --prune
' '

View File

@ -914,7 +914,7 @@ test_expect_success 'git notes copy --stdin' '
${indent} ${indent}
${indent}yet another note ${indent}yet another note
EOF EOF
(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \ (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^) &&
echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) | echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |
git notes copy --stdin && git notes copy --stdin &&
git log -2 >actual && git log -2 >actual &&
@ -939,7 +939,7 @@ test_expect_success 'git notes copy --for-rewrite (unconfigured)' '
EOF EOF
test_commit 14th && test_commit 14th &&
test_commit 15th && test_commit 15th &&
(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \ (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^) &&
echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) | echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |
git notes copy --for-rewrite=foo && git notes copy --for-rewrite=foo &&
git log -2 >actual && git log -2 >actual &&
@ -972,7 +972,7 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' '
EOF EOF
test_config notes.rewriteMode overwrite && test_config notes.rewriteMode overwrite &&
test_config notes.rewriteRef "refs/notes/*" && test_config notes.rewriteRef "refs/notes/*" &&
(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \ (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^) &&
echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) | echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |
git notes copy --for-rewrite=foo && git notes copy --for-rewrite=foo &&
git log -2 >actual && git log -2 >actual &&
@ -1059,7 +1059,7 @@ test_expect_success 'git notes copy --for-rewrite (append two to one)' '
git notes add -f -m"append 2" HEAD^^ && git notes add -f -m"append 2" HEAD^^ &&
test_config notes.rewriteMode concatenate && test_config notes.rewriteMode concatenate &&
test_config notes.rewriteRef "refs/notes/*" && test_config notes.rewriteRef "refs/notes/*" &&
(echo $(git rev-parse HEAD^) $(git rev-parse HEAD); (echo $(git rev-parse HEAD^) $(git rev-parse HEAD) &&
echo $(git rev-parse HEAD^^) $(git rev-parse HEAD)) | echo $(git rev-parse HEAD^^) $(git rev-parse HEAD)) |
git notes copy --for-rewrite=foo && git notes copy --for-rewrite=foo &&
git log -1 >actual && git log -1 >actual &&

View File

@ -200,10 +200,10 @@ test_expect_success 'rebase -q is quiet' '
test_expect_success 'Rebase a commit that sprinkles CRs in' ' test_expect_success 'Rebase a commit that sprinkles CRs in' '
( (
echo "One" echo "One" &&
echo "TwoQ" echo "TwoQ" &&
echo "Three" echo "Three" &&
echo "FQur" echo "FQur" &&
echo "Five" echo "Five"
) | q_to_cr >CR && ) | q_to_cr >CR &&
git add CR && git add CR &&

View File

@ -25,7 +25,7 @@ test_expect_success setup '
git commit -a -m"master updates a bit more." && git commit -a -m"master updates a bit more." &&
git checkout side && git checkout side &&
(echo "0 $T" ; cat original) >renamed && (echo "0 $T" && cat original) >renamed &&
git add renamed && git add renamed &&
git update-index --force-remove original && git update-index --force-remove original &&
git commit -a -m"side renames and edits." && git commit -a -m"side renames and edits." &&
@ -143,7 +143,7 @@ test_expect_success 'rebase -s funny -Xopt' '
git checkout -b test-funny master^ && git checkout -b test-funny master^ &&
test_commit funny && test_commit funny &&
( (
PATH=./test-bin:$PATH PATH=./test-bin:$PATH &&
git rebase -s funny -Xopt master git rebase -s funny -Xopt master
) && ) &&
test -f funny.was.run test -f funny.was.run

View File

@ -516,7 +516,7 @@ test_expect_success 'interrupted squash works as expected' '
one=$(git rev-parse HEAD~3) && one=$(git rev-parse HEAD~3) &&
set_fake_editor && set_fake_editor &&
test_must_fail env FAKE_LINES="1 squash 3 2" git rebase -i HEAD~3 && test_must_fail env FAKE_LINES="1 squash 3 2" git rebase -i HEAD~3 &&
(echo one; echo two; echo four) > conflict && test_write_lines one two four > conflict &&
git add conflict && git add conflict &&
test_must_fail git rebase --continue && test_must_fail git rebase --continue &&
echo resolved > conflict && echo resolved > conflict &&
@ -530,10 +530,10 @@ test_expect_success 'interrupted squash works as expected (case 2)' '
one=$(git rev-parse HEAD~3) && one=$(git rev-parse HEAD~3) &&
set_fake_editor && set_fake_editor &&
test_must_fail env FAKE_LINES="3 squash 1 2" git rebase -i HEAD~3 && test_must_fail env FAKE_LINES="3 squash 1 2" git rebase -i HEAD~3 &&
(echo one; echo four) > conflict && test_write_lines one four > conflict &&
git add conflict && git add conflict &&
test_must_fail git rebase --continue && test_must_fail git rebase --continue &&
(echo one; echo two; echo four) > conflict && test_write_lines one two four > conflict &&
git add conflict && git add conflict &&
test_must_fail git rebase --continue && test_must_fail git rebase --continue &&
echo resolved > conflict && echo resolved > conflict &&

View File

@ -60,7 +60,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
EOF EOF
chmod +x test-bin/git-merge-funny && chmod +x test-bin/git-merge-funny &&
( (
PATH=./test-bin:$PATH PATH=./test-bin:$PATH &&
test_must_fail git rebase -s funny -Xopt master topic test_must_fail git rebase -s funny -Xopt master topic
) && ) &&
test -f funny.was.run && test -f funny.was.run &&
@ -68,7 +68,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
echo "Resolved" >F2 && echo "Resolved" >F2 &&
git add F2 && git add F2 &&
( (
PATH=./test-bin:$PATH PATH=./test-bin:$PATH &&
git rebase --continue git rebase --continue
) && ) &&
test -f funny.was.run test -f funny.was.run

View File

@ -156,9 +156,9 @@ test_expect_success 'git add with filemode=0, symlinks=0, and unmerged entries'
test_expect_success 'git add with filemode=0, symlinks=0 prefers stage 2 over stage 1' ' test_expect_success 'git add with filemode=0, symlinks=0 prefers stage 2 over stage 1' '
git rm --cached -f file symlink && git rm --cached -f file symlink &&
( (
echo "100644 $(git hash-object -w stage1) 1 file" echo "100644 $(git hash-object -w stage1) 1 file" &&
echo "100755 $(git hash-object -w stage2) 2 file" echo "100755 $(git hash-object -w stage2) 2 file" &&
echo "100644 $(printf 1 | git hash-object -w -t blob --stdin) 1 symlink" echo "100644 $(printf 1 | git hash-object -w -t blob --stdin) 1 symlink" &&
echo "120000 $(printf 2 | git hash-object -w -t blob --stdin) 2 symlink" echo "120000 $(printf 2 | git hash-object -w -t blob --stdin) 2 symlink"
) | git update-index --index-info && ) | git update-index --index-info &&
git config core.filemode 0 && git config core.filemode 0 &&
@ -265,7 +265,7 @@ test_expect_success 'git add to resolve conflicts on otherwise ignored path' '
git reset --hard && git reset --hard &&
H=$(git rev-parse :1/2/a) && H=$(git rev-parse :1/2/a) &&
( (
echo "100644 $H 1 track-this" echo "100644 $H 1 track-this" &&
echo "100644 $H 3 track-this" echo "100644 $H 3 track-this"
) | git update-index --index-info && ) | git update-index --index-info &&
echo track-this >>.gitignore && echo track-this >>.gitignore &&

View File

@ -46,13 +46,13 @@ test_expect_success 'setup expected' '
' '
test_expect_success 'diff works (initial)' ' test_expect_success 'diff works (initial)' '
(echo d; echo 1) | git add -i >output && test_write_lines d 1 | git add -i >output &&
sed -ne "/new file/,/content/p" <output >diff && sed -ne "/new file/,/content/p" <output >diff &&
diff_cmp expected diff diff_cmp expected diff
' '
test_expect_success 'revert works (initial)' ' test_expect_success 'revert works (initial)' '
git add file && git add file &&
(echo r; echo 1) | git add -i && test_write_lines r 1 | git add -i &&
git ls-files >output && git ls-files >output &&
! grep . output ! grep . output
' '
@ -83,13 +83,13 @@ test_expect_success 'setup expected' '
' '
test_expect_success 'diff works (commit)' ' test_expect_success 'diff works (commit)' '
(echo d; echo 1) | git add -i >output && test_write_lines d 1 | git add -i >output &&
sed -ne "/^index/,/content/p" <output >diff && sed -ne "/^index/,/content/p" <output >diff &&
diff_cmp expected diff diff_cmp expected diff
' '
test_expect_success 'revert works (commit)' ' test_expect_success 'revert works (commit)' '
git add file && git add file &&
(echo r; echo 1) | git add -i && test_write_lines r 1 | git add -i &&
git add -i </dev/null >output && git add -i </dev/null >output &&
grep "unchanged *+3/-0 file" output grep "unchanged *+3/-0 file" output
' '
@ -102,7 +102,7 @@ test_expect_success 'setup expected' '
test_expect_success 'dummy edit works' ' test_expect_success 'dummy edit works' '
test_set_editor : && test_set_editor : &&
(echo e; echo a) | git add -p && test_write_lines e a | git add -p &&
git diff > diff && git diff > diff &&
diff_cmp expected diff diff_cmp expected diff
' '
@ -127,7 +127,7 @@ test_expect_success 'setup fake editor' '
test_expect_success 'bad edit rejected' ' test_expect_success 'bad edit rejected' '
git reset && git reset &&
(echo e; echo n; echo d) | git add -p >output && test_write_lines e n d | git add -p >output &&
grep "hunk does not apply" output grep "hunk does not apply" output
' '
@ -140,7 +140,7 @@ test_expect_success 'setup patch' '
test_expect_success 'garbage edit rejected' ' test_expect_success 'garbage edit rejected' '
git reset && git reset &&
(echo e; echo n; echo d) | git add -p >output && test_write_lines e n d | git add -p >output &&
grep "hunk does not apply" output grep "hunk does not apply" output
' '
@ -170,7 +170,7 @@ test_expect_success 'setup expected' '
' '
test_expect_success 'real edit works' ' test_expect_success 'real edit works' '
(echo e; echo n; echo d) | git add -p && test_write_lines e n d | git add -p &&
git diff >output && git diff >output &&
diff_cmp expected output diff_cmp expected output
' '

View File

@ -29,14 +29,14 @@ test_expect_success 'setup' '
test_expect_success 'saying "n" does nothing' ' test_expect_success 'saying "n" does nothing' '
set_state HEAD HEADfile_work HEADfile_index && set_state HEAD HEADfile_work HEADfile_index &&
set_state dir/foo work index && set_state dir/foo work index &&
(echo n; echo n; echo n) | test_must_fail git stash save -p && test_write_lines n n n | test_must_fail git stash save -p &&
verify_state HEAD HEADfile_work HEADfile_index && verify_state HEAD HEADfile_work HEADfile_index &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo work index verify_state dir/foo work index
' '
test_expect_success 'git stash -p' ' test_expect_success 'git stash -p' '
(echo y; echo n; echo y) | git stash save -p && test_write_lines y n y | git stash save -p &&
verify_state HEAD committed HEADfile_index && verify_state HEAD committed HEADfile_index &&
verify_saved_state bar && verify_saved_state bar &&
verify_state dir/foo head index && verify_state dir/foo head index &&
@ -51,7 +51,7 @@ test_expect_success 'git stash -p --no-keep-index' '
set_state HEAD HEADfile_work HEADfile_index && set_state HEAD HEADfile_work HEADfile_index &&
set_state bar bar_work bar_index && set_state bar bar_work bar_index &&
set_state dir/foo work index && set_state dir/foo work index &&
(echo y; echo n; echo y) | git stash save -p --no-keep-index && test_write_lines y n y | git stash save -p --no-keep-index &&
verify_state HEAD committed committed && verify_state HEAD committed committed &&
verify_state bar bar_work dummy && verify_state bar bar_work dummy &&
verify_state dir/foo head head && verify_state dir/foo head head &&
@ -66,7 +66,7 @@ test_expect_success 'git stash --no-keep-index -p' '
set_state HEAD HEADfile_work HEADfile_index && set_state HEAD HEADfile_work HEADfile_index &&
set_state bar bar_work bar_index && set_state bar bar_work bar_index &&
set_state dir/foo work index && set_state dir/foo work index &&
(echo y; echo n; echo y) | git stash save --no-keep-index -p && test_write_lines y n y | git stash save --no-keep-index -p &&
verify_state HEAD committed committed && verify_state HEAD committed committed &&
verify_state dir/foo head head && verify_state dir/foo head head &&
verify_state bar bar_work dummy && verify_state bar bar_work dummy &&

View File

@ -180,7 +180,7 @@ test_expect_success 'setup for many rename source candidates' '
git add "path??" && git add "path??" &&
test_tick && test_tick &&
git commit -m "hundred" && git commit -m "hundred" &&
(cat path1; echo new) >new-path && (cat path1 && echo new) >new-path &&
echo old >>path1 && echo old >>path1 &&
git add new-path path1 && git add new-path path1 &&
git diff -l 4 -C -C --cached --name-status >actual 2>actual.err && git diff -l 4 -C -C --cached --name-status >actual 2>actual.err &&

View File

@ -111,10 +111,10 @@ test_expect_success 'diff-tree -r with wildcard' '
test_expect_success 'setup submodules' ' test_expect_success 'setup submodules' '
test_tick && test_tick &&
git init submod && git init submod &&
( cd submod && test_commit first; ) && ( cd submod && test_commit first ) &&
git add submod && git add submod &&
git commit -m first && git commit -m first &&
( cd submod && test_commit second; ) && ( cd submod && test_commit second ) &&
git add submod && git add submod &&
git commit -m second git commit -m second
' '

View File

@ -102,10 +102,8 @@ test_expect_success 'apply binary patch' '
test_expect_success 'diff --no-index with binary creation' ' test_expect_success 'diff --no-index with binary creation' '
echo Q | q_to_nul >binary && echo Q | q_to_nul >binary &&
(: hide error code from diff, which just indicates differences # hide error code from diff, which just indicates differences
git diff --binary --no-index /dev/null binary >current || test_might_fail git diff --binary --no-index /dev/null binary >current &&
true
) &&
rm binary && rm binary &&
git apply --binary <current && git apply --binary <current &&
echo Q >expected && echo Q >expected &&

View File

@ -127,17 +127,17 @@ test_expect_success setup '
for n in $sample for n in $sample
do do
( zs $n ; echo a ) >file-a$n && ( zs $n && echo a ) >file-a$n &&
( echo b; zs $n; echo ) >file-b$n && ( echo b && zs $n && echo ) >file-b$n &&
( printf c; zs $n ) >file-c$n && ( printf c && zs $n ) >file-c$n &&
( echo d; zs $n ) >file-d$n && ( echo d && zs $n ) >file-d$n &&
git add file-a$n file-b$n file-c$n file-d$n && git add file-a$n file-b$n file-c$n file-d$n &&
( zs $n ; echo A ) >file-a$n && ( zs $n && echo A ) >file-a$n &&
( echo B; zs $n; echo ) >file-b$n && ( echo B && zs $n && echo ) >file-b$n &&
( printf C; zs $n ) >file-c$n && ( printf C && zs $n ) >file-c$n &&
( echo D; zs $n ) >file-d$n && ( echo D && zs $n ) >file-d$n &&
expect_pattern $n || return 1 expect_pattern $n || return 1

View File

@ -12,12 +12,12 @@ NS="$N$N$N$N$N$N$N$N$N$N$N$N$N"
test_expect_success setup ' test_expect_success setup '
( (
echo "A $NS" echo "A $NS" &&
for c in B C D E F G H I J K for c in B C D E F G H I J K
do do
echo " $c" echo " $c"
done done &&
echo "L $NS" echo "L $NS" &&
for c in M N O P Q R S T U V for c in M N O P Q R S T U V
do do
echo " $c" echo " $c"
@ -34,7 +34,7 @@ test_expect_success 'hunk header truncation with an overly long line' '
git diff | sed -n -e "s/^.*@@//p" >actual && git diff | sed -n -e "s/^.*@@//p" >actual &&
( (
echo " A $N$N$N$N$N$N$N$N$N2" echo " A $N$N$N$N$N$N$N$N$N2" &&
echo " L $N$N$N$N$N$N$N$N$N1" echo " L $N$N$N$N$N$N$N$N$N1"
) >expected && ) >expected &&
test_cmp actual expected test_cmp actual expected

View File

@ -498,7 +498,7 @@ test_expect_success 'given commit --submodule=short' '
test_expect_success 'setup .git file for sm2' ' test_expect_success 'setup .git file for sm2' '
(cd sm2 && (cd sm2 &&
REAL="$(pwd)/../.real" && REAL="$(pwd)/../.real" &&
mv .git "$REAL" mv .git "$REAL" &&
echo "gitdir: $REAL" >.git) echo "gitdir: $REAL" >.git)
' '
@ -527,7 +527,7 @@ test_expect_success 'diff --submodule with objects referenced by alternates' '
git commit -m "sub a" git commit -m "sub a"
) && ) &&
(cd sub_alt && (cd sub_alt &&
sha1_before=$(git rev-parse --short HEAD) sha1_before=$(git rev-parse --short HEAD) &&
echo b >b && echo b >b &&
git add b && git add b &&
git commit -m b && git commit -m b &&

View File

@ -721,7 +721,7 @@ test_expect_success 'given commit' '
test_expect_success 'setup .git file for sm2' ' test_expect_success 'setup .git file for sm2' '
(cd sm2 && (cd sm2 &&
REAL="$(pwd)/../.real" && REAL="$(pwd)/../.real" &&
mv .git "$REAL" mv .git "$REAL" &&
echo "gitdir: $REAL" >.git) echo "gitdir: $REAL" >.git)
' '

View File

@ -27,6 +27,6 @@ test_expect_success 'setup' \
test_expect_success \ test_expect_success \
'check if contextually independent diffs for the same file apply' \ 'check if contextually independent diffs for the same file apply' \
'( git diff test~2 test~1; git diff test~1 test~0 )| git apply' '( git diff test~2 test~1 && git diff test~1 test~0 )| git apply'
test_done test_done

View File

@ -191,7 +191,7 @@ test_expect_success 'survive missing objects/pack directory' '
mkdir missing-pack && mkdir missing-pack &&
cd missing-pack && cd missing-pack &&
git init && git init &&
GOP=.git/objects/pack GOP=.git/objects/pack &&
rm -fr $GOP && rm -fr $GOP &&
git index-pack --stdin --keep=test <../test-3-${packname_3}.pack && git index-pack --stdin --keep=test <../test-3-${packname_3}.pack &&
test -f $GOP/pack-${packname_3}.pack && test -f $GOP/pack-${packname_3}.pack &&

View File

@ -237,7 +237,7 @@ test_expect_success 'running index-pack in the object store' '
rm -f .git/objects/pack/* && rm -f .git/objects/pack/* &&
cp test-1-${pack1}.pack .git/objects/pack/pack-${pack1}.pack && cp test-1-${pack1}.pack .git/objects/pack/pack-${pack1}.pack &&
( (
cd .git/objects/pack cd .git/objects/pack &&
git index-pack pack-${pack1}.pack git index-pack pack-${pack1}.pack
) && ) &&
test -f .git/objects/pack/pack-${pack1}.idx test -f .git/objects/pack/pack-${pack1}.idx

View File

@ -86,7 +86,7 @@ test_expect_success 'push can be used to delete a ref' '
test_expect_success 'refuse deleting push with denyDeletes' ' test_expect_success 'refuse deleting push with denyDeletes' '
( (
cd victim && cd victim &&
( git branch -D extra || : ) && test_might_fail git branch -D extra &&
git config receive.denyDeletes true && git config receive.denyDeletes true &&
git branch extra master git branch extra master
) && ) &&
@ -119,7 +119,7 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
test_expect_success 'denyNonFastforwards trumps --force' ' test_expect_success 'denyNonFastforwards trumps --force' '
( (
cd victim && cd victim &&
( git branch -D extra || : ) && test_might_fail git branch -D extra &&
git config receive.denyNonFastforwards true git config receive.denyNonFastforwards true
) && ) &&
victim_orig=$(cd victim && git rev-parse --verify master) && victim_orig=$(cd victim && git rev-parse --verify master) &&

View File

@ -82,13 +82,13 @@ test_expect_success 'hooks ran' '
' '
test_expect_success 'pre-receive hook input' ' test_expect_success 'pre-receive hook input' '
(echo $commit0 $commit1 refs/heads/master; (echo $commit0 $commit1 refs/heads/master &&
echo $commit1 $commit0 refs/heads/tofail echo $commit1 $commit0 refs/heads/tofail
) | test_cmp - victim.git/pre-receive.stdin ) | test_cmp - victim.git/pre-receive.stdin
' '
test_expect_success 'update hook arguments' ' test_expect_success 'update hook arguments' '
(echo refs/heads/master $commit0 $commit1; (echo refs/heads/master $commit0 $commit1 &&
echo refs/heads/tofail $commit1 $commit0 echo refs/heads/tofail $commit1 $commit0
) | test_cmp - victim.git/update.args ) | test_cmp - victim.git/update.args
' '

View File

@ -25,8 +25,7 @@ test_expect_success 'non forced push should die not segfault' '
( (
cd another && cd another &&
git push .. master:master test_must_fail git push .. master:master
test $? = 1
) )
' '

View File

@ -6,8 +6,9 @@ test_description='remote push rejects are reported by client'
test_expect_success 'setup' ' test_expect_success 'setup' '
mkdir .git/hooks && mkdir .git/hooks &&
(echo "#!/bin/sh" ; echo "exit 1") >.git/hooks/update && write_script .git/hooks/update <<-\EOF &&
chmod +x .git/hooks/update && exit 1
EOF
echo 1 >file && echo 1 >file &&
git add file && git add file &&
git commit -m 1 && git commit -m 1 &&

View File

@ -259,7 +259,7 @@ test_expect_success 'clone shallow object count' '
test_expect_success 'pull in shallow repo with missing merge base' ' test_expect_success 'pull in shallow repo with missing merge base' '
( (
cd shallow && cd shallow &&
git fetch --depth 4 .. A git fetch --depth 4 .. A &&
test_must_fail git merge --allow-unrelated-histories FETCH_HEAD test_must_fail git merge --allow-unrelated-histories FETCH_HEAD
) )
' '

View File

@ -348,17 +348,13 @@ URL: $(pwd)/one
EOF EOF
test_expect_success 'prune --dry-run' ' test_expect_success 'prune --dry-run' '
( git -C one branch -m side2 side &&
cd one && test_when_finished "git -C one branch -m side side2" &&
git branch -m side2 side) &&
( (
cd test && cd test &&
git remote prune --dry-run origin >output && git remote prune --dry-run origin >output &&
git rev-parse refs/remotes/origin/side2 && git rev-parse refs/remotes/origin/side2 &&
test_must_fail git rev-parse refs/remotes/origin/side && test_must_fail git rev-parse refs/remotes/origin/side &&
(
cd ../one &&
git branch -m side side2) &&
test_i18ncmp expect output test_i18ncmp expect output
) )
' '
@ -848,7 +844,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)'
git remote rename origin origin && git remote rename origin origin &&
test_path_is_missing .git/branches/origin && test_path_is_missing .git/branches/origin &&
test "$(git config remote.origin.url)" = "quux" && test "$(git config remote.origin.url)" = "quux" &&
test "$(git config remote.origin.fetch)" = "refs/heads/foom:refs/heads/origin" test "$(git config remote.origin.fetch)" = "refs/heads/foom:refs/heads/origin" &&
test "$(git config remote.origin.push)" = "HEAD:refs/heads/foom" test "$(git config remote.origin.push)" = "HEAD:refs/heads/foom"
) )
' '

View File

@ -15,7 +15,7 @@ test_expect_success setup '
git tag mark1.10 && git tag mark1.10 &&
git show-ref --tags -d | sed -e "s/ / /" >expected.tag && git show-ref --tags -d | sed -e "s/ / /" >expected.tag &&
( (
echo "$(git rev-parse HEAD) HEAD" echo "$(git rev-parse HEAD) HEAD" &&
git show-ref -d | sed -e "s/ / /" git show-ref -d | sed -e "s/ / /"
) >expected.all && ) >expected.all &&
@ -105,7 +105,7 @@ test_expect_success 'use branch.<name>.remote if possible' '
git clone . other.git && git clone . other.git &&
( (
cd other.git && cd other.git &&
echo "$(git rev-parse HEAD) HEAD" echo "$(git rev-parse HEAD) HEAD" &&
git show-ref | sed -e "s/ / /" git show-ref | sed -e "s/ / /"
) >exp && ) >exp &&

View File

@ -923,7 +923,7 @@ test_expect_success 'push into aliased refs (consistent)' '
( (
cd child1 && cd child1 &&
git branch foo && git branch foo &&
git symbolic-ref refs/heads/bar refs/heads/foo git symbolic-ref refs/heads/bar refs/heads/foo &&
git config receive.denyCurrentBranch false git config receive.denyCurrentBranch false
) && ) &&
( (
@ -945,7 +945,7 @@ test_expect_success 'push into aliased refs (inconsistent)' '
( (
cd child1 && cd child1 &&
git branch foo && git branch foo &&
git symbolic-ref refs/heads/bar refs/heads/foo git symbolic-ref refs/heads/bar refs/heads/foo &&
git config receive.denyCurrentBranch false git config receive.denyCurrentBranch false
) && ) &&
( (
@ -1011,7 +1011,7 @@ test_expect_success 'push --porcelain rejected' '
mk_empty testrepo && mk_empty testrepo &&
git push testrepo refs/heads/master:refs/remotes/origin/master && git push testrepo refs/heads/master:refs/remotes/origin/master &&
(cd testrepo && (cd testrepo &&
git reset --hard origin/master^ git reset --hard origin/master^ &&
git config receive.denyCurrentBranch true) && git config receive.denyCurrentBranch true) &&
echo >.git/foo "To testrepo" && echo >.git/foo "To testrepo" &&
@ -1025,7 +1025,7 @@ test_expect_success 'push --porcelain --dry-run rejected' '
mk_empty testrepo && mk_empty testrepo &&
git push testrepo refs/heads/master:refs/remotes/origin/master && git push testrepo refs/heads/master:refs/remotes/origin/master &&
(cd testrepo && (cd testrepo &&
git reset --hard origin/master git reset --hard origin/master &&
git config receive.denyCurrentBranch true) && git config receive.denyCurrentBranch true) &&
echo >.git/foo "To testrepo" && echo >.git/foo "To testrepo" &&
@ -1333,7 +1333,7 @@ test_expect_success 'push --follow-tag only pushes relevant tags' '
git commit --allow-empty -m "future commit" && git commit --allow-empty -m "future commit" &&
git tag -m "future" future && git tag -m "future" future &&
git checkout master && git checkout master &&
git for-each-ref refs/heads/master refs/tags/tag >../expect git for-each-ref refs/heads/master refs/tags/tag >../expect &&
git push --follow-tag ../dst master git push --follow-tag ../dst master
) && ) &&
( (

View File

@ -71,7 +71,7 @@ test_expect_success 'push mirror force updates existing branches' '
git push --mirror up && git push --mirror up &&
echo two >foo && git add foo && git commit -m two && echo two >foo && git add foo && git commit -m two &&
git push --mirror up && git push --mirror up &&
git reset --hard HEAD^ git reset --hard HEAD^ &&
git push --mirror up git push --mirror up
) && ) &&
master_master=$(cd master && git show-ref -s --verify refs/heads/master) && master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
@ -88,7 +88,7 @@ test_expect_success 'push mirror removes branches' '
echo one >foo && git add foo && git commit -m one && echo one >foo && git add foo && git commit -m one &&
git branch remove master && git branch remove master &&
git push --mirror up && git push --mirror up &&
git branch -D remove git branch -D remove &&
git push --mirror up git push --mirror up
) && ) &&
( (
@ -170,7 +170,7 @@ test_expect_success 'push mirror force updates existing tags' '
echo two >foo && git add foo && git commit -m two && echo two >foo && git add foo && git commit -m two &&
git tag -f tmaster master && git tag -f tmaster master &&
git push --mirror up && git push --mirror up &&
git reset --hard HEAD^ git reset --hard HEAD^ &&
git tag -f tmaster master && git tag -f tmaster master &&
git push --mirror up git push --mirror up
) && ) &&
@ -188,7 +188,7 @@ test_expect_success 'push mirror removes tags' '
echo one >foo && git add foo && git commit -m one && echo one >foo && git add foo && git commit -m one &&
git tag -f tremove master && git tag -f tremove master &&
git push --mirror up && git push --mirror up &&
git tag -d tremove git tag -d tremove &&
git push --mirror up git push --mirror up
) && ) &&
( (
@ -235,7 +235,7 @@ test_expect_success 'remote.foo.mirror adds and removes branches' '
git branch keep master && git branch keep master &&
git branch remove master && git branch remove master &&
git push up && git push up &&
git branch -D remove git branch -D remove &&
git push up git push up
) && ) &&
( (

View File

@ -379,7 +379,7 @@ test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necess
git config -f .gitmodules submodule.subdir/deepsubmodule.fetchRecursive false git config -f .gitmodules submodule.subdir/deepsubmodule.fetchRecursive false
) && ) &&
git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err && git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err &&
git config --unset fetch.recurseSubmodules git config --unset fetch.recurseSubmodules &&
( (
cd submodule && cd submodule &&
git config --unset -f .gitmodules submodule.subdir/deepsubmodule.fetchRecursive git config --unset -f .gitmodules submodule.subdir/deepsubmodule.fetchRecursive

View File

@ -354,7 +354,7 @@ test_expect_success 'push succeeds if submodule has no remote and is on the firs
git clone a a1 && git clone a a1 &&
( (
cd a1 && cd a1 &&
git init b git init b &&
( (
cd b && cd b &&
>junk && >junk &&

View File

@ -178,7 +178,7 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus
test_expect_success 'atomic push is not advertised if configured' ' test_expect_success 'atomic push is not advertised if configured' '
mk_repo_pair && mk_repo_pair &&
( (
cd upstream cd upstream &&
git config receive.advertiseatomic 0 git config receive.advertiseatomic 0
) && ) &&
( (

View File

@ -618,7 +618,7 @@ hex2oct () {
test_expect_success 'clone on case-insensitive fs' ' test_expect_success 'clone on case-insensitive fs' '
git init icasefs && git init icasefs &&
( (
cd icasefs cd icasefs &&
o=$(git hash-object -w --stdin </dev/null | hex2oct) && o=$(git hash-object -w --stdin </dev/null | hex2oct) &&
t=$(printf "100644 X\0${o}100644 x\0${o}" | t=$(printf "100644 X\0${o}100644 x\0${o}" |
git hash-object -w -t tree --stdin) && git hash-object -w -t tree --stdin) &&

View File

@ -94,7 +94,7 @@ test_expect_success 'clone empty repository' '
git config receive.denyCurrentBranch warn) && git config receive.denyCurrentBranch warn) &&
git clone empty empty-clone && git clone empty empty-clone &&
test_tick && test_tick &&
(cd empty-clone (cd empty-clone &&
echo "content" >> foo && echo "content" >> foo &&
git add foo && git add foo &&
git commit -m "Initial commit" && git commit -m "Initial commit" &&

View File

@ -23,7 +23,7 @@ test_expect_success CLONE_2GB 'setup' '
printf "blob\nmark :$i\ndata $blobsize\n" && printf "blob\nmark :$i\ndata $blobsize\n" &&
#test-tool genrandom $i $blobsize && #test-tool genrandom $i $blobsize &&
printf "%-${blobsize}s" $i && printf "%-${blobsize}s" $i &&
echo "M 100644 :$i $i" >> commit echo "M 100644 :$i $i" >> commit &&
i=$(($i+1)) || i=$(($i+1)) ||
echo $? > exit-status echo $? > exit-status
done && done &&

View File

@ -96,7 +96,7 @@ test_expect_success 'push new branch with old:new refspec' '
test_expect_success 'push new branch with HEAD:new refspec' ' test_expect_success 'push new branch with HEAD:new refspec' '
(cd local && (cd local &&
git checkout new-name git checkout new-name &&
git push origin HEAD:new-refspec-2 git push origin HEAD:new-refspec-2
) && ) &&
compare_refs local HEAD server refs/heads/new-refspec-2 compare_refs local HEAD server refs/heads/new-refspec-2

View File

@ -245,7 +245,7 @@ test_expect_success 'using reflog to find the fork point' '
git commit --allow-empty -m "Derived #$count" && git commit --allow-empty -m "Derived #$count" &&
git rev-parse HEAD >derived$count && git rev-parse HEAD >derived$count &&
git checkout -B base $E || exit 1 git checkout -B base $E || exit 1
done done &&
for count in 1 2 3 for count in 1 2 3
do do

View File

@ -55,7 +55,7 @@ test_expect_success 'initial merge' '
git checkout -b work && git checkout -b work &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 git-gui/git-gui.sh" echo "100644 $o1 0 git-gui/git-gui.sh" &&
echo "100644 $o2 0 git.c" echo "100644 $o2 0 git.c"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -72,7 +72,7 @@ test_expect_success 'merge update' '
git pull -s subtree gui master2 && git pull -s subtree gui master2 &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o3 0 git-gui/git-gui.sh" echo "100644 $o3 0 git-gui/git-gui.sh" &&
echo "100644 $o2 0 git.c" echo "100644 $o2 0 git.c"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -88,8 +88,8 @@ test_expect_success 'initial ambiguous subtree' '
git checkout -b work2 && git checkout -b work2 &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 git-gui/git-gui.sh" echo "100644 $o1 0 git-gui/git-gui.sh" &&
echo "100644 $o1 0 git-gui2/git-gui.sh" echo "100644 $o1 0 git-gui2/git-gui.sh" &&
echo "100644 $o2 0 git.c" echo "100644 $o2 0 git.c"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -101,8 +101,8 @@ test_expect_success 'merge using explicit' '
git pull -Xsubtree=git-gui gui master2 && git pull -Xsubtree=git-gui gui master2 &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o3 0 git-gui/git-gui.sh" echo "100644 $o3 0 git-gui/git-gui.sh" &&
echo "100644 $o1 0 git-gui2/git-gui.sh" echo "100644 $o1 0 git-gui2/git-gui.sh" &&
echo "100644 $o2 0 git.c" echo "100644 $o2 0 git.c"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -114,8 +114,8 @@ test_expect_success 'merge2 using explicit' '
git pull -Xsubtree=git-gui2 gui master2 && git pull -Xsubtree=git-gui2 gui master2 &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 git-gui/git-gui.sh" echo "100644 $o1 0 git-gui/git-gui.sh" &&
echo "100644 $o3 0 git-gui2/git-gui.sh" echo "100644 $o3 0 git-gui2/git-gui.sh" &&
echo "100644 $o2 0 git.c" echo "100644 $o2 0 git.c"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual

View File

@ -72,7 +72,7 @@ test_expect_success 'merge simple rename+criss-cross with no modifications' '
git rev-parse >actual \ git rev-parse >actual \
:2:three :3:three && :2:three :3:three &&
git hash-object >>actual \ git hash-object >>actual \
three~HEAD three~R2^0 three~HEAD three~R2^0 &&
test_cmp expect actual test_cmp expect actual
) )
' '
@ -148,7 +148,7 @@ test_expect_success 'merge criss-cross + rename merges with basic modification'
git rev-parse >actual \ git rev-parse >actual \
:2:three :3:three && :2:three :3:three &&
git hash-object >>actual \ git hash-object >>actual \
three~HEAD three~R2^0 three~HEAD three~R2^0 &&
test_cmp expect actual test_cmp expect actual
) )
' '
@ -228,7 +228,7 @@ test_expect_success 'git detects differently handled merges conflict' '
D:new_a E:new_a && D:new_a E:new_a &&
git rev-parse >actual \ git rev-parse >actual \
:2:new_a :3:new_a && :2:new_a :3:new_a &&
test_cmp expect actual test_cmp expect actual &&
git cat-file -p B:new_a >ours && git cat-file -p B:new_a >ours &&
git cat-file -p C:new_a >theirs && git cat-file -p C:new_a >theirs &&
@ -577,10 +577,10 @@ test_expect_success 'merge of D1 & E2 fails but has appropriate contents' '
test_line_count = 2 out && test_line_count = 2 out &&
git rev-parse >expect \ git rev-parse >expect \
B:a E2:a/file c:a/file A:ignore-me && B:a E2:a/file C:a/file A:ignore-me &&
git rev-parse >actual \ git rev-parse >actual \
:2:a :3:a/file :1:a/file :0:ignore-me && :2:a :3:a/file :1:a/file :0:ignore-me &&
test_cmp expect actual test_cmp expect actual &&
test_path_is_file a~HEAD test_path_is_file a~HEAD
) )
@ -604,10 +604,10 @@ test_expect_success 'merge of E2 & D1 fails but has appropriate contents' '
test_line_count = 2 out && test_line_count = 2 out &&
git rev-parse >expect \ git rev-parse >expect \
B:a E2:a/file c:a/file A:ignore-me && B:a E2:a/file C:a/file A:ignore-me &&
git rev-parse >actual \ git rev-parse >actual \
:3:a :2:a/file :1:a/file :0:ignore-me && :3:a :2:a/file :1:a/file :0:ignore-me &&
test_cmp expect actual test_cmp expect actual &&
test_path_is_file a~D1^0 test_path_is_file a~D1^0
) )

View File

@ -352,7 +352,7 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
base:file left-conflict:newfile right:file && base:file left-conflict:newfile right:file &&
git rev-parse >actual \ git rev-parse >actual \
:1:newfile :2:newfile :3:newfile && :1:newfile :2:newfile :3:newfile &&
test_cmp expect actual test_cmp expect actual &&
test_path_is_file newfile/realfile && test_path_is_file newfile/realfile &&
test_path_is_file newfile~HEAD test_path_is_file newfile~HEAD
@ -580,7 +580,7 @@ test_expect_failure 'detect conflict with rename/rename(1to2)/add-source merge'
C:a A:a B:b C:C && C:a A:a B:b C:C &&
git rev-parse >actual \ git rev-parse >actual \
:3:a :1:a :2:b :3:c && :3:a :1:a :2:b :3:c &&
test_cmp expect actual test_cmp expect actual &&
test_path_is_file a && test_path_is_file a &&
test_path_is_file b && test_path_is_file b &&
@ -680,13 +680,13 @@ test_expect_success 'rename/rename/add-dest merge still knows about conflicting
A:a C:b B:b C:c B:c && A:a C:b B:b C:c B:c &&
git rev-parse >actual \ git rev-parse >actual \
:1:a :2:b :3:b :2:c :3:c && :1:a :2:b :3:b :2:c :3:c &&
test_cmp expect actual test_cmp expect actual &&
git rev-parse >expect \ git rev-parse >expect \
C:c B:c C:b B:b && C:c B:c C:b B:b &&
git hash-object >actual \ git hash-object >actual \
c~HEAD c~B\^0 b~HEAD b~B\^0 && c~HEAD c~B\^0 b~HEAD b~B\^0 &&
test_cmp expect actual test_cmp expect actual &&
test_path_is_missing b && test_path_is_missing b &&
test_path_is_missing c test_path_is_missing c

View File

@ -3583,7 +3583,7 @@ test_expect_success '11d-check: Avoid losing not-uptodate with rename + D/F conf
grep -q stuff z/c && grep -q stuff z/c &&
test_seq 1 10 >expected && test_seq 1 10 >expected &&
echo stuff >>expected && echo stuff >>expected &&
test_cmp expected z/c test_cmp expected z/c &&
git ls-files -s >out && git ls-files -s >out &&
test_line_count = 4 out && test_line_count = 4 out &&

View File

@ -509,7 +509,7 @@ test_expect_success 'moving nested submodules' '
touch nested_level1 && touch nested_level1 &&
git init && git init &&
git add . && git add . &&
git commit -m "nested level 1" git commit -m "nested level 1" &&
git submodule add ../sub_nested_nested && git submodule add ../sub_nested_nested &&
git commit -m "add nested level 2" git commit -m "add nested level 2"
) && ) &&

View File

@ -19,20 +19,20 @@ test_expect_success PERL 'setup' '
test_expect_success PERL 'saying "n" does nothing' ' test_expect_success PERL 'saying "n" does nothing' '
set_and_save_state dir/foo work work && set_and_save_state dir/foo work work &&
(echo n; echo n) | git reset -p && test_write_lines n n | git reset -p &&
verify_saved_state dir/foo && verify_saved_state dir/foo &&
verify_saved_state bar verify_saved_state bar
' '
test_expect_success PERL 'git reset -p' ' test_expect_success PERL 'git reset -p' '
(echo n; echo y) | git reset -p >output && test_write_lines n y | git reset -p >output &&
verify_state dir/foo work head && verify_state dir/foo work head &&
verify_saved_state bar && verify_saved_state bar &&
test_i18ngrep "Unstage" output test_i18ngrep "Unstage" output
' '
test_expect_success PERL 'git reset -p HEAD^' ' test_expect_success PERL 'git reset -p HEAD^' '
(echo n; echo y) | git reset -p HEAD^ >output && test_write_lines n y | git reset -p HEAD^ >output &&
verify_state dir/foo work parent && verify_state dir/foo work parent &&
verify_saved_state bar && verify_saved_state bar &&
test_i18ngrep "Apply" output test_i18ngrep "Apply" output
@ -45,20 +45,20 @@ test_expect_success PERL 'git reset -p HEAD^' '
test_expect_success PERL 'git reset -p dir' ' test_expect_success PERL 'git reset -p dir' '
set_state dir/foo work work && set_state dir/foo work work &&
(echo y; echo n) | git reset -p dir && test_write_lines y n | git reset -p dir &&
verify_state dir/foo work head && verify_state dir/foo work head &&
verify_saved_state bar verify_saved_state bar
' '
test_expect_success PERL 'git reset -p -- foo (inside dir)' ' test_expect_success PERL 'git reset -p -- foo (inside dir)' '
set_state dir/foo work work && set_state dir/foo work work &&
(echo y; echo n) | (cd dir && git reset -p -- foo) && test_write_lines y n | (cd dir && git reset -p -- foo) &&
verify_state dir/foo work head && verify_state dir/foo work head &&
verify_saved_state bar verify_saved_state bar
' '
test_expect_success PERL 'git reset -p HEAD^ -- dir' ' test_expect_success PERL 'git reset -p HEAD^ -- dir' '
(echo y; echo n) | git reset -p HEAD^ -- dir && test_write_lines y n | git reset -p HEAD^ -- dir &&
verify_state dir/foo work parent && verify_state dir/foo work parent &&
verify_saved_state bar verify_saved_state bar
' '

View File

@ -528,10 +528,10 @@ test_expect_success 'checkout with --merge' '
cat sample >filf && cat sample >filf &&
git checkout -m -- fild file filf && git checkout -m -- fild file filf &&
( (
echo "<<<<<<< ours" echo "<<<<<<< ours" &&
echo ourside echo ourside &&
echo "=======" echo "=======" &&
echo theirside echo theirside &&
echo ">>>>>>> theirs" echo ">>>>>>> theirs"
) >merged && ) >merged &&
test_cmp expect fild && test_cmp expect fild &&
@ -549,12 +549,12 @@ test_expect_success 'checkout with --merge, in diff3 -m style' '
cat sample >filf && cat sample >filf &&
git checkout -m -- fild file filf && git checkout -m -- fild file filf &&
( (
echo "<<<<<<< ours" echo "<<<<<<< ours" &&
echo ourside echo ourside &&
echo "||||||| base" echo "||||||| base" &&
echo original echo original &&
echo "=======" echo "=======" &&
echo theirside echo theirside &&
echo ">>>>>>> theirs" echo ">>>>>>> theirs"
) >merged && ) >merged &&
test_cmp expect fild && test_cmp expect fild &&
@ -572,10 +572,10 @@ test_expect_success 'checkout --conflict=merge, overriding config' '
cat sample >filf && cat sample >filf &&
git checkout --conflict=merge -- fild file filf && git checkout --conflict=merge -- fild file filf &&
( (
echo "<<<<<<< ours" echo "<<<<<<< ours" &&
echo ourside echo ourside &&
echo "=======" echo "=======" &&
echo theirside echo theirside &&
echo ">>>>>>> theirs" echo ">>>>>>> theirs"
) >merged && ) >merged &&
test_cmp expect fild && test_cmp expect fild &&
@ -593,12 +593,12 @@ test_expect_success 'checkout --conflict=diff3' '
cat sample >filf && cat sample >filf &&
git checkout --conflict=diff3 -- fild file filf && git checkout --conflict=diff3 -- fild file filf &&
( (
echo "<<<<<<< ours" echo "<<<<<<< ours" &&
echo ourside echo ourside &&
echo "||||||| base" echo "||||||| base" &&
echo original echo original &&
echo "=======" echo "=======" &&
echo theirside echo theirside &&
echo ">>>>>>> theirs" echo ">>>>>>> theirs"
) >merged && ) >merged &&
test_cmp expect fild && test_cmp expect fild &&
@ -673,7 +673,6 @@ test_expect_success 'custom merge driver with checkout -m' '
do do
grep $t arm || exit 1 grep $t arm || exit 1
done done
exit 0
) && ) &&
mv arm expect && mv arm expect &&

View File

@ -107,7 +107,7 @@ test_expect_success 'git clean -id (filter all)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo f; echo "*"; echo; echo c) | \ test_write_lines f "*" "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -129,7 +129,7 @@ test_expect_success 'git clean -id (filter patterns)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo f; echo "part3.* *.out"; echo; echo c) | \ test_write_lines f "part3.* *.out" "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -151,7 +151,7 @@ test_expect_success 'git clean -id (filter patterns 2)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo f; echo "* !*.out"; echo; echo c) | \ test_write_lines f "* !*.out" "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -173,7 +173,7 @@ test_expect_success 'git clean -id (select - all)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo s; echo "*"; echo; echo c) | \ test_write_lines s "*" "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -195,7 +195,7 @@ test_expect_success 'git clean -id (select - none)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo s; echo; echo c) | \ test_write_lines s "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -217,7 +217,7 @@ test_expect_success 'git clean -id (select - number)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo s; echo 3; echo; echo c) | \ test_write_lines s 3 "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -239,7 +239,7 @@ test_expect_success 'git clean -id (select - number 2)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo s; echo 2 3; echo 5; echo; echo c) | \ test_write_lines s "2 3" 5 "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -261,7 +261,7 @@ test_expect_success 'git clean -id (select - number 3)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo s; echo 3,4 5; echo; echo c) | \ test_write_lines s "3,4 5" "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -282,7 +282,7 @@ test_expect_success 'git clean -id (select - filenames)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out foo.txt bar.txt baz.txt && touch a.out foo.txt bar.txt baz.txt &&
(echo s; echo a.out fo ba bar; echo; echo c) | \ test_write_lines s "a.out fo ba bar" "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test ! -f a.out && test ! -f a.out &&
@ -298,7 +298,7 @@ test_expect_success 'git clean -id (select - range)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo s; echo 1,3-4; echo 2; echo; echo c) | \ test_write_lines s "1,3-4" 2 "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -320,7 +320,7 @@ test_expect_success 'git clean -id (select - range 2)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo s; echo 4- 1; echo; echo c) | \ test_write_lines s "4- 1" "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -342,7 +342,7 @@ test_expect_success 'git clean -id (inverse select)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo s; echo "*"; echo -5- 1 -2; echo; echo c) | \ test_write_lines s "*" "-5- 1 -2" "" c |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -364,7 +364,7 @@ test_expect_success 'git clean -id (ask)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo a; echo Y; echo y; echo no; echo yes; echo bad; echo) | \ test_write_lines a Y y no yes bad "" |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -386,7 +386,7 @@ test_expect_success 'git clean -id (ask - Ctrl+D)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(echo a; echo Y; echo no; echo yes; echo "\04") | \ test_write_lines a Y no yes "\04" |
git clean -id && git clean -id &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -408,8 +408,8 @@ test_expect_success 'git clean -id with prefix and path (filter)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(cd build/ && \ (cd build/ &&
(echo f; echo "docs"; echo "*.h"; echo ; echo c) | \ test_write_lines f docs "*.h" "" c |
git clean -id ..) && git clean -id ..) &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -431,9 +431,8 @@ test_expect_success 'git clean -id with prefix and path (select by name)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(cd build/ && \ (cd build/ &&
(echo s; echo "../docs/"; echo "../src/part3.c"; \ test_write_lines s ../docs/ ../src/part3.c ../src/part4.c "" c |
echo "../src/part4.c"; echo; echo c) | \
git clean -id ..) && git clean -id ..) &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&
@ -455,8 +454,8 @@ test_expect_success 'git clean -id with prefix and path (ask)' '
mkdir -p build docs && mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so && docs/manual.txt obj.o build/lib.so &&
(cd build/ && \ (cd build/ &&
(echo a; echo Y; echo y; echo no; echo yes; echo bad; echo) | \ test_write_lines a Y y no yes bad "" |
git clean -id ..) && git clean -id ..) &&
test -f Makefile && test -f Makefile &&
test -f README && test -f README &&

View File

@ -171,12 +171,13 @@ test_expect_success 'submodule add to .gitignored path with --force' '
test_expect_success 'submodule add to reconfigure existing submodule with --force' ' test_expect_success 'submodule add to reconfigure existing submodule with --force' '
( (
cd addtest-ignore && cd addtest-ignore &&
git submodule add --force bogus-url submod && bogus_url="$(pwd)/bogus-url" &&
git submodule add -b initial "$submodurl" submod-branch && git submodule add --force "$bogus_url" submod &&
test "bogus-url" = "$(git config -f .gitmodules submodule.submod.url)" && git submodule add --force -b initial "$submodurl" submod-branch &&
test "bogus-url" = "$(git config submodule.submod.url)" && test "$bogus_url" = "$(git config -f .gitmodules submodule.submod.url)" &&
test "$bogus_url" = "$(git config submodule.submod.url)" &&
# Restore the url # Restore the url
git submodule add --force "$submodurl" submod git submodule add --force "$submodurl" submod &&
test "$submodurl" = "$(git config -f .gitmodules submodule.submod.url)" && test "$submodurl" = "$(git config -f .gitmodules submodule.submod.url)" &&
test "$submodurl" = "$(git config submodule.submod.url)" test "$submodurl" = "$(git config submodule.submod.url)"
) )
@ -818,7 +819,7 @@ test_expect_success '../bar/a/b/c works with relative local path - ../foo/bar.gi
cp pristine-.git-config .git/config && cp pristine-.git-config .git/config &&
cp pristine-.gitmodules .gitmodules && cp pristine-.gitmodules .gitmodules &&
mkdir -p a/b/c && mkdir -p a/b/c &&
(cd a/b/c; git init) && (cd a/b/c && git init) &&
git config remote.origin.url ../foo/bar.git && git config remote.origin.url ../foo/bar.git &&
git submodule add ../bar/a/b/c ./a/b/c && git submodule add ../bar/a/b/c ./a/b/c &&
git submodule init && git submodule init &&

View File

@ -865,9 +865,9 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
(cd submodule/subsubmodule && (cd submodule/subsubmodule &&
git log > ../../expected git log > ../../expected
) && ) &&
(cd .git/modules/submodule/modules/subsubmodule (cd .git/modules/submodule/modules/subsubmodule &&
git log > ../../../../../actual git log > ../../../../../actual
) ) &&
test_cmp actual expected test_cmp actual expected
) )
' '
@ -886,7 +886,7 @@ test_expect_success 'submodule update properly revives a moved submodule' '
git commit -am "pre move" && git commit -am "pre move" &&
H2=$(git rev-parse --short HEAD) && H2=$(git rev-parse --short HEAD) &&
git status | sed "s/$H/XXX/" >expect && git status | sed "s/$H/XXX/" >expect &&
H=$(cd submodule2; git rev-parse HEAD) && H=$(cd submodule2 && git rev-parse HEAD) &&
git rm --cached submodule2 && git rm --cached submodule2 &&
rm -rf submodule2 && rm -rf submodule2 &&
mkdir -p "moved/sub module" && mkdir -p "moved/sub module" &&

View File

@ -148,7 +148,7 @@ test_expect_success 'preparing second superproject with a nested submodule plus
cd supersuper && cd supersuper &&
echo "I am super super." >file && echo "I am super super." >file &&
git add file && git add file &&
git commit -m B-super-super-initial git commit -m B-super-super-initial &&
git submodule add "file://$base_dir/super" subwithsub && git submodule add "file://$base_dir/super" subwithsub &&
git commit -m B-super-super-added && git commit -m B-super-super-added &&
git submodule update --init --recursive && git submodule update --init --recursive &&

View File

@ -47,7 +47,7 @@ test_expect_success 'paths and -a do not mix' '
test_expect_success PERL 'can use paths with --interactive' ' test_expect_success PERL 'can use paths with --interactive' '
echo bong-o-bong >file && echo bong-o-bong >file &&
# 2: update, 1:st path, that is all, 7: quit # 2: update, 1:st path, that is all, 7: quit
( echo 2; echo 1; echo; echo 7 ) | test_write_lines 2 1 "" 7 |
git commit -m foo --interactive file && git commit -m foo --interactive file &&
git reset --hard HEAD^ git reset --hard HEAD^
' '
@ -293,7 +293,7 @@ test_expect_success PERL 'interactive add' '
test_expect_success PERL "commit --interactive doesn't change index if editor aborts" ' test_expect_success PERL "commit --interactive doesn't change index if editor aborts" '
echo zoo >file && echo zoo >file &&
test_must_fail git diff --exit-code >diff1 && test_must_fail git diff --exit-code >diff1 &&
(echo u ; echo "*" ; echo q) | test_write_lines u "*" q |
( (
EDITOR=: && EDITOR=: &&
export EDITOR && export EDITOR &&
@ -411,8 +411,8 @@ test_expect_success 'sign off (1)' '
git commit -s -m "thank you" && git commit -s -m "thank you" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
( (
echo thank you echo thank you &&
echo echo &&
git var GIT_COMMITTER_IDENT | git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected && ) >expected &&
@ -430,9 +430,9 @@ test_expect_success 'sign off (2)' '
$existing" && $existing" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
( (
echo thank you echo thank you &&
echo echo &&
echo $existing echo $existing &&
git var GIT_COMMITTER_IDENT | git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected && ) >expected &&
@ -450,9 +450,9 @@ test_expect_success 'signoff gap' '
$alt" && $alt" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" > actual && git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
( (
echo welcome echo welcome &&
echo echo &&
echo $alt echo $alt &&
git var GIT_COMMITTER_IDENT | git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected && ) >expected &&
@ -470,11 +470,11 @@ We have now
$alt" && $alt" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" > actual && git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
( (
echo welcome echo welcome &&
echo echo &&
echo We have now echo We have now &&
echo $alt echo $alt &&
echo echo &&
git var GIT_COMMITTER_IDENT | git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected && ) >expected &&
@ -491,11 +491,11 @@ non-trailer line
Myfooter: x" && Myfooter: x" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" > actual && git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
( (
echo subject echo subject &&
echo echo &&
echo non-trailer line echo non-trailer line &&
echo Myfooter: x echo Myfooter: x &&
echo echo &&
echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
@ -508,10 +508,10 @@ non-trailer line
Myfooter: x" && Myfooter: x" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" > actual && git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
( (
echo subject echo subject &&
echo echo &&
echo non-trailer line echo non-trailer line &&
echo Myfooter: x echo Myfooter: x &&
echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual
@ -524,10 +524,10 @@ test_expect_success 'multiple -m' '
git commit -m "one" -m "two" -m "three" && git commit -m "one" -m "two" -m "three" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
( (
echo one echo one &&
echo echo &&
echo two echo two &&
echo echo &&
echo three echo three
) >expected && ) >expected &&
test_cmp expected actual test_cmp expected actual

View File

@ -193,9 +193,9 @@ test_expect_success 'status with added and untracked file in modified submodule
test_expect_success 'setup .git file for sub' ' test_expect_success 'setup .git file for sub' '
(cd sub && (cd sub &&
rm -f new-file rm -f new-file &&
REAL="$(pwd)/../.real" && REAL="$(pwd)/../.real" &&
mv .git "$REAL" mv .git "$REAL" &&
echo "gitdir: $REAL" >.git) && echo "gitdir: $REAL" >.git) &&
echo .real >>.gitignore && echo .real >>.gitignore &&
git commit -m "added .real to .gitignore" .gitignore git commit -m "added .real to .gitignore" .gitignore
@ -209,12 +209,12 @@ test_expect_success 'status with added file in modified submodule with .git file
test_expect_success 'status with a lot of untracked files in the submodule' ' test_expect_success 'status with a lot of untracked files in the submodule' '
( (
cd sub cd sub &&
i=0 && i=0 &&
while test $i -lt 1024 while test $i -lt 1024
do do
>some-file-$i >some-file-$i &&
i=$(( $i + 1 )) i=$(( $i + 1 )) || exit 1
done done
) && ) &&
git status --porcelain sub 2>err.actual && git status --porcelain sub 2>err.actual &&

View File

@ -57,18 +57,18 @@ test_expect_success 'setup' '
git checkout -b delete-base branch1 && git checkout -b delete-base branch1 &&
mkdir -p a/a && mkdir -p a/a &&
(echo one; echo two; echo 3; echo 4) >a/a/file.txt && test_write_lines one two 3 4 >a/a/file.txt &&
git add a/a/file.txt && git add a/a/file.txt &&
git commit -m"base file" && git commit -m"base file" &&
git checkout -b move-to-b delete-base && git checkout -b move-to-b delete-base &&
mkdir -p b/b && mkdir -p b/b &&
git mv a/a/file.txt b/b/file.txt && git mv a/a/file.txt b/b/file.txt &&
(echo one; echo two; echo 4) >b/b/file.txt && test_write_lines one two 4 >b/b/file.txt &&
git commit -a -m"move to b" && git commit -a -m"move to b" &&
git checkout -b move-to-c delete-base && git checkout -b move-to-c delete-base &&
mkdir -p c/c && mkdir -p c/c &&
git mv a/a/file.txt c/c/file.txt && git mv a/a/file.txt c/c/file.txt &&
(echo one; echo two; echo 3) >c/c/file.txt && test_write_lines one two 3 >c/c/file.txt &&
git commit -a -m"move to c" && git commit -a -m"move to c" &&
git checkout -b stash1 master && git checkout -b stash1 master &&
@ -349,7 +349,7 @@ test_expect_success 'mergetool keeps tempfiles when aborting delete/delete' '
git checkout -b test$test_count move-to-c && git checkout -b test$test_count move-to-c &&
test_config mergetool.keepTemporaries true && test_config mergetool.keepTemporaries true &&
test_must_fail git merge move-to-b && test_must_fail git merge move-to-b &&
! (echo a; echo n) | git mergetool a/a/file.txt && ! test_write_lines a n | git mergetool a/a/file.txt &&
test -d a/a && test -d a/a &&
cat >expect <<-\EOF && cat >expect <<-\EOF &&
file_BASE_.txt file_BASE_.txt

View File

@ -940,10 +940,9 @@ test_expect_success 'grep from a subdirectory to search wider area (1)' '
test_expect_success 'grep from a subdirectory to search wider area (2)' ' test_expect_success 'grep from a subdirectory to search wider area (2)' '
mkdir -p s && mkdir -p s &&
( (
cd s || exit 1 cd s &&
( git grep xxyyzz .. >out ; echo $? >status ) test_expect_code 1 git grep xxyyzz .. >out &&
! test -s out && ! test -s out
test 1 = $(cat status)
) )
' '

View File

@ -332,7 +332,7 @@ test_expect_success $PREREQ 'Show all headers' '
test_expect_success $PREREQ 'Prompting works' ' test_expect_success $PREREQ 'Prompting works' '
clean_fake_sendmail && clean_fake_sendmail &&
(echo "to@example.com" (echo "to@example.com" &&
echo "" echo ""
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \ ) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
--smtp-server="$(pwd)/fake.sendmail" \ --smtp-server="$(pwd)/fake.sendmail" \
@ -509,8 +509,8 @@ test_expect_success $PREREQ 'Invalid In-Reply-To' '
test_expect_success $PREREQ 'Valid In-Reply-To when prompting' ' test_expect_success $PREREQ 'Valid In-Reply-To when prompting' '
clean_fake_sendmail && clean_fake_sendmail &&
(echo "From Example <from@example.com>" (echo "From Example <from@example.com>" &&
echo "To Example <to@example.com>" echo "To Example <to@example.com>" &&
echo "" echo ""
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \ ) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
--smtp-server="$(pwd)/fake.sendmail" \ --smtp-server="$(pwd)/fake.sendmail" \
@ -2023,11 +2023,11 @@ test_expect_success $PREREQ 'invoke hook' '
# Verify error message when a patch is rejected by the hook # Verify error message when a patch is rejected by the hook
sed -e "s/add master/x/" ../0001-add-master.patch >../another.patch && sed -e "s/add master/x/" ../0001-add-master.patch >../another.patch &&
git send-email \ test_must_fail git send-email \
--from="Example <nobody@example.com>" \ --from="Example <nobody@example.com>" \
--to=nobody@example.com \ --to=nobody@example.com \
--smtp-server="$(pwd)/../fake.sendmail" \ --smtp-server="$(pwd)/../fake.sendmail" \
../another.patch 2>err ../another.patch 2>err &&
test_i18ngrep "rejected by sendemail-validate hook" err test_i18ngrep "rejected by sendemail-validate hook" err
) )
' '

View File

@ -31,7 +31,7 @@ test_expect_success \
( (
cd import && cd import &&
echo foo >foo && echo foo >foo &&
ln -s foo foo.link ln -s foo foo.link &&
mkdir -p dir/a/b/c/d/e && mkdir -p dir/a/b/c/d/e &&
echo "deep dir" >dir/a/b/c/d/e/file && echo "deep dir" >dir/a/b/c/d/e/file &&
mkdir bar && mkdir bar &&

View File

@ -149,7 +149,7 @@ test_expect_success 'test show-ignore' "
svn_cmd up && svn_cmd up &&
svn_cmd propset -R svn:ignore ' svn_cmd propset -R svn:ignore '
no-such-file* no-such-file*
' . ' . &&
svn_cmd commit -m 'propset svn:ignore' svn_cmd commit -m 'propset svn:ignore'
) && ) &&
git svn show-ignore > show-ignore.got && git svn show-ignore > show-ignore.got &&

View File

@ -22,8 +22,8 @@ esac
# same value as "svn info" (i.e. the commit timestamp that touched the # same value as "svn info" (i.e. the commit timestamp that touched the
# path most recently); do not expect that field to match. # path most recently); do not expect that field to match.
test_cmp_info () { test_cmp_info () {
sed -e '/^Text Last Updated:/d' "$1" >tmp.expect sed -e '/^Text Last Updated:/d' "$1" >tmp.expect &&
sed -e '/^Text Last Updated:/d' "$2" >tmp.actual sed -e '/^Text Last Updated:/d' "$2" >tmp.actual &&
test_cmp tmp.expect tmp.actual && test_cmp tmp.expect tmp.actual &&
rm -f tmp.expect tmp.actual rm -f tmp.expect tmp.actual
} }
@ -59,24 +59,24 @@ test_expect_success 'setup repository and import' '
' '
test_expect_success 'info' " test_expect_success 'info' "
(cd svnwc; svn info) > expected.info && (cd svnwc && svn info) > expected.info &&
(cd gitwc; git svn info) > actual.info && (cd gitwc && git svn info) > actual.info &&
test_cmp_info expected.info actual.info test_cmp_info expected.info actual.info
" "
test_expect_success 'info --url' ' test_expect_success 'info --url' '
test "$(cd gitwc; git svn info --url)" = "$quoted_svnrepo" test "$(cd gitwc && git svn info --url)" = "$quoted_svnrepo"
' '
test_expect_success 'info .' " test_expect_success 'info .' "
(cd svnwc; svn info .) > expected.info-dot && (cd svnwc && svn info .) > expected.info-dot &&
(cd gitwc; git svn info .) > actual.info-dot && (cd gitwc && git svn info .) > actual.info-dot &&
test_cmp_info expected.info-dot actual.info-dot test_cmp_info expected.info-dot actual.info-dot
" "
test_expect_success 'info $(pwd)' ' test_expect_success 'info $(pwd)' '
(cd svnwc; svn info "$(pwd)") >expected.info-pwd && (cd svnwc && svn info "$(pwd)") >expected.info-pwd &&
(cd gitwc; git svn info "$(pwd)") >actual.info-pwd && (cd gitwc && git svn info "$(pwd)") >actual.info-pwd &&
grep -v ^Path: <expected.info-pwd >expected.info-np && grep -v ^Path: <expected.info-pwd >expected.info-np &&
grep -v ^Path: <actual.info-pwd >actual.info-np && grep -v ^Path: <actual.info-pwd >actual.info-np &&
test_cmp_info expected.info-np actual.info-np && test_cmp_info expected.info-np actual.info-np &&
@ -85,8 +85,8 @@ test_expect_success 'info $(pwd)' '
' '
test_expect_success 'info $(pwd)/../___wc' ' test_expect_success 'info $(pwd)/../___wc' '
(cd svnwc; svn info "$(pwd)/../svnwc") >expected.info-pwd && (cd svnwc && svn info "$(pwd)/../svnwc") >expected.info-pwd &&
(cd gitwc; git svn info "$(pwd)/../gitwc") >actual.info-pwd && (cd gitwc && git svn info "$(pwd)/../gitwc") >actual.info-pwd &&
grep -v ^Path: <expected.info-pwd >expected.info-np && grep -v ^Path: <expected.info-pwd >expected.info-np &&
grep -v ^Path: <actual.info-pwd >actual.info-np && grep -v ^Path: <actual.info-pwd >actual.info-np &&
test_cmp_info expected.info-np actual.info-np && test_cmp_info expected.info-np actual.info-np &&
@ -95,8 +95,8 @@ test_expect_success 'info $(pwd)/../___wc' '
' '
test_expect_success 'info $(pwd)/../___wc//file' ' test_expect_success 'info $(pwd)/../___wc//file' '
(cd svnwc; svn info "$(pwd)/../svnwc//file") >expected.info-pwd && (cd svnwc && svn info "$(pwd)/../svnwc//file") >expected.info-pwd &&
(cd gitwc; git svn info "$(pwd)/../gitwc//file") >actual.info-pwd && (cd gitwc && git svn info "$(pwd)/../gitwc//file") >actual.info-pwd &&
grep -v ^Path: <expected.info-pwd >expected.info-np && grep -v ^Path: <expected.info-pwd >expected.info-np &&
grep -v ^Path: <actual.info-pwd >actual.info-np && grep -v ^Path: <actual.info-pwd >actual.info-np &&
test_cmp_info expected.info-np actual.info-np && test_cmp_info expected.info-np actual.info-np &&
@ -105,56 +105,56 @@ test_expect_success 'info $(pwd)/../___wc//file' '
' '
test_expect_success 'info --url .' ' test_expect_success 'info --url .' '
test "$(cd gitwc; git svn info --url .)" = "$quoted_svnrepo" test "$(cd gitwc && git svn info --url .)" = "$quoted_svnrepo"
' '
test_expect_success 'info file' " test_expect_success 'info file' "
(cd svnwc; svn info file) > expected.info-file && (cd svnwc && svn info file) > expected.info-file &&
(cd gitwc; git svn info file) > actual.info-file && (cd gitwc && git svn info file) > actual.info-file &&
test_cmp_info expected.info-file actual.info-file test_cmp_info expected.info-file actual.info-file
" "
test_expect_success 'info --url file' ' test_expect_success 'info --url file' '
test "$(cd gitwc; git svn info --url file)" = "$quoted_svnrepo/file" test "$(cd gitwc && git svn info --url file)" = "$quoted_svnrepo/file"
' '
test_expect_success 'info directory' " test_expect_success 'info directory' "
(cd svnwc; svn info directory) > expected.info-directory && (cd svnwc && svn info directory) > expected.info-directory &&
(cd gitwc; git svn info directory) > actual.info-directory && (cd gitwc && git svn info directory) > actual.info-directory &&
test_cmp_info expected.info-directory actual.info-directory test_cmp_info expected.info-directory actual.info-directory
" "
test_expect_success 'info inside directory' " test_expect_success 'info inside directory' "
(cd svnwc/directory; svn info) > expected.info-inside-directory && (cd svnwc/directory && svn info) > expected.info-inside-directory &&
(cd gitwc/directory; git svn info) > actual.info-inside-directory && (cd gitwc/directory && git svn info) > actual.info-inside-directory &&
test_cmp_info expected.info-inside-directory actual.info-inside-directory test_cmp_info expected.info-inside-directory actual.info-inside-directory
" "
test_expect_success 'info --url directory' ' test_expect_success 'info --url directory' '
test "$(cd gitwc; git svn info --url directory)" = "$quoted_svnrepo/directory" test "$(cd gitwc && git svn info --url directory)" = "$quoted_svnrepo/directory"
' '
test_expect_success 'info symlink-file' " test_expect_success 'info symlink-file' "
(cd svnwc; svn info symlink-file) > expected.info-symlink-file && (cd svnwc && svn info symlink-file) > expected.info-symlink-file &&
(cd gitwc; git svn info symlink-file) > actual.info-symlink-file && (cd gitwc && git svn info symlink-file) > actual.info-symlink-file &&
test_cmp_info expected.info-symlink-file actual.info-symlink-file test_cmp_info expected.info-symlink-file actual.info-symlink-file
" "
test_expect_success 'info --url symlink-file' ' test_expect_success 'info --url symlink-file' '
test "$(cd gitwc; git svn info --url symlink-file)" \ test "$(cd gitwc && git svn info --url symlink-file)" \
= "$quoted_svnrepo/symlink-file" = "$quoted_svnrepo/symlink-file"
' '
test_expect_success 'info symlink-directory' " test_expect_success 'info symlink-directory' "
(cd svnwc; svn info symlink-directory) \ (cd svnwc && svn info symlink-directory) \
> expected.info-symlink-directory && > expected.info-symlink-directory &&
(cd gitwc; git svn info symlink-directory) \ (cd gitwc && git svn info symlink-directory) \
> actual.info-symlink-directory && > actual.info-symlink-directory &&
test_cmp_info expected.info-symlink-directory actual.info-symlink-directory test_cmp_info expected.info-symlink-directory actual.info-symlink-directory
" "
test_expect_success 'info --url symlink-directory' ' test_expect_success 'info --url symlink-directory' '
test "$(cd gitwc; git svn info --url symlink-directory)" \ test "$(cd gitwc && git svn info --url symlink-directory)" \
= "$quoted_svnrepo/symlink-directory" = "$quoted_svnrepo/symlink-directory"
' '
@ -169,13 +169,13 @@ test_expect_success 'info added-file' "
cd svnwc && cd svnwc &&
svn_cmd add added-file > /dev/null svn_cmd add added-file > /dev/null
) && ) &&
(cd svnwc; svn info added-file) > expected.info-added-file && (cd svnwc && svn info added-file) > expected.info-added-file &&
(cd gitwc; git svn info added-file) > actual.info-added-file && (cd gitwc && git svn info added-file) > actual.info-added-file &&
test_cmp_info expected.info-added-file actual.info-added-file test_cmp_info expected.info-added-file actual.info-added-file
" "
test_expect_success 'info --url added-file' ' test_expect_success 'info --url added-file' '
test "$(cd gitwc; git svn info --url added-file)" \ test "$(cd gitwc && git svn info --url added-file)" \
= "$quoted_svnrepo/added-file" = "$quoted_svnrepo/added-file"
' '
@ -190,15 +190,15 @@ test_expect_success 'info added-directory' "
cd gitwc && cd gitwc &&
git add added-directory git add added-directory
) && ) &&
(cd svnwc; svn info added-directory) \ (cd svnwc && svn info added-directory) \
> expected.info-added-directory && > expected.info-added-directory &&
(cd gitwc; git svn info added-directory) \ (cd gitwc && git svn info added-directory) \
> actual.info-added-directory && > actual.info-added-directory &&
test_cmp_info expected.info-added-directory actual.info-added-directory test_cmp_info expected.info-added-directory actual.info-added-directory
" "
test_expect_success 'info --url added-directory' ' test_expect_success 'info --url added-directory' '
test "$(cd gitwc; git svn info --url added-directory)" \ test "$(cd gitwc && git svn info --url added-directory)" \
= "$quoted_svnrepo/added-directory" = "$quoted_svnrepo/added-directory"
' '
@ -213,16 +213,16 @@ test_expect_success 'info added-symlink-file' "
ln -s added-file added-symlink-file && ln -s added-file added-symlink-file &&
svn_cmd add added-symlink-file > /dev/null svn_cmd add added-symlink-file > /dev/null
) && ) &&
(cd svnwc; svn info added-symlink-file) \ (cd svnwc && svn info added-symlink-file) \
> expected.info-added-symlink-file && > expected.info-added-symlink-file &&
(cd gitwc; git svn info added-symlink-file) \ (cd gitwc && git svn info added-symlink-file) \
> actual.info-added-symlink-file && > actual.info-added-symlink-file &&
test_cmp_info expected.info-added-symlink-file \ test_cmp_info expected.info-added-symlink-file \
actual.info-added-symlink-file actual.info-added-symlink-file
" "
test_expect_success 'info --url added-symlink-file' ' test_expect_success 'info --url added-symlink-file' '
test "$(cd gitwc; git svn info --url added-symlink-file)" \ test "$(cd gitwc && git svn info --url added-symlink-file)" \
= "$quoted_svnrepo/added-symlink-file" = "$quoted_svnrepo/added-symlink-file"
' '
@ -237,16 +237,16 @@ test_expect_success 'info added-symlink-directory' "
ln -s added-directory added-symlink-directory && ln -s added-directory added-symlink-directory &&
svn_cmd add added-symlink-directory > /dev/null svn_cmd add added-symlink-directory > /dev/null
) && ) &&
(cd svnwc; svn info added-symlink-directory) \ (cd svnwc && svn info added-symlink-directory) \
> expected.info-added-symlink-directory && > expected.info-added-symlink-directory &&
(cd gitwc; git svn info added-symlink-directory) \ (cd gitwc && git svn info added-symlink-directory) \
> actual.info-added-symlink-directory && > actual.info-added-symlink-directory &&
test_cmp_info expected.info-added-symlink-directory \ test_cmp_info expected.info-added-symlink-directory \
actual.info-added-symlink-directory actual.info-added-symlink-directory
" "
test_expect_success 'info --url added-symlink-directory' ' test_expect_success 'info --url added-symlink-directory' '
test "$(cd gitwc; git svn info --url added-symlink-directory)" \ test "$(cd gitwc && git svn info --url added-symlink-directory)" \
= "$quoted_svnrepo/added-symlink-directory" = "$quoted_svnrepo/added-symlink-directory"
' '
@ -259,13 +259,13 @@ test_expect_success 'info deleted-file' "
cd svnwc && cd svnwc &&
svn_cmd rm --force file > /dev/null svn_cmd rm --force file > /dev/null
) && ) &&
(cd svnwc; svn info file) >expected.info-deleted-file && (cd svnwc && svn info file) >expected.info-deleted-file &&
(cd gitwc; git svn info file) >actual.info-deleted-file && (cd gitwc && git svn info file) >actual.info-deleted-file &&
test_cmp_info expected.info-deleted-file actual.info-deleted-file test_cmp_info expected.info-deleted-file actual.info-deleted-file
" "
test_expect_success 'info --url file (deleted)' ' test_expect_success 'info --url file (deleted)' '
test "$(cd gitwc; git svn info --url file)" \ test "$(cd gitwc && git svn info --url file)" \
= "$quoted_svnrepo/file" = "$quoted_svnrepo/file"
' '
@ -278,13 +278,13 @@ test_expect_success 'info deleted-directory' "
cd svnwc && cd svnwc &&
svn_cmd rm --force directory > /dev/null svn_cmd rm --force directory > /dev/null
) && ) &&
(cd svnwc; svn info directory) >expected.info-deleted-directory && (cd svnwc && svn info directory) >expected.info-deleted-directory &&
(cd gitwc; git svn info directory) >actual.info-deleted-directory && (cd gitwc && git svn info directory) >actual.info-deleted-directory &&
test_cmp_info expected.info-deleted-directory actual.info-deleted-directory test_cmp_info expected.info-deleted-directory actual.info-deleted-directory
" "
test_expect_success 'info --url directory (deleted)' ' test_expect_success 'info --url directory (deleted)' '
test "$(cd gitwc; git svn info --url directory)" \ test "$(cd gitwc && git svn info --url directory)" \
= "$quoted_svnrepo/directory" = "$quoted_svnrepo/directory"
' '
@ -297,13 +297,13 @@ test_expect_success 'info deleted-symlink-file' "
cd svnwc && cd svnwc &&
svn_cmd rm --force symlink-file > /dev/null svn_cmd rm --force symlink-file > /dev/null
) && ) &&
(cd svnwc; svn info symlink-file) >expected.info-deleted-symlink-file && (cd svnwc && svn info symlink-file) >expected.info-deleted-symlink-file &&
(cd gitwc; git svn info symlink-file) >actual.info-deleted-symlink-file && (cd gitwc && git svn info symlink-file) >actual.info-deleted-symlink-file &&
test_cmp_info expected.info-deleted-symlink-file actual.info-deleted-symlink-file test_cmp_info expected.info-deleted-symlink-file actual.info-deleted-symlink-file
" "
test_expect_success 'info --url symlink-file (deleted)' ' test_expect_success 'info --url symlink-file (deleted)' '
test "$(cd gitwc; git svn info --url symlink-file)" \ test "$(cd gitwc && git svn info --url symlink-file)" \
= "$quoted_svnrepo/symlink-file" = "$quoted_svnrepo/symlink-file"
' '
@ -316,13 +316,13 @@ test_expect_success 'info deleted-symlink-directory' "
cd svnwc && cd svnwc &&
svn_cmd rm --force symlink-directory > /dev/null svn_cmd rm --force symlink-directory > /dev/null
) && ) &&
(cd svnwc; svn info symlink-directory) >expected.info-deleted-symlink-directory && (cd svnwc && svn info symlink-directory) >expected.info-deleted-symlink-directory &&
(cd gitwc; git svn info symlink-directory) >actual.info-deleted-symlink-directory && (cd gitwc && git svn info symlink-directory) >actual.info-deleted-symlink-directory &&
test_cmp_info expected.info-deleted-symlink-directory actual.info-deleted-symlink-directory test_cmp_info expected.info-deleted-symlink-directory actual.info-deleted-symlink-directory
" "
test_expect_success 'info --url symlink-directory (deleted)' ' test_expect_success 'info --url symlink-directory (deleted)' '
test "$(cd gitwc; git svn info --url symlink-directory)" \ test "$(cd gitwc && git svn info --url symlink-directory)" \
= "$quoted_svnrepo/symlink-directory" = "$quoted_svnrepo/symlink-directory"
' '
@ -331,27 +331,27 @@ test_expect_success 'info --url symlink-directory (deleted)' '
test_expect_success 'info unknown-file' " test_expect_success 'info unknown-file' "
echo two > gitwc/unknown-file && echo two > gitwc/unknown-file &&
(cd gitwc; test_must_fail git svn info unknown-file) \ (cd gitwc && test_must_fail git svn info unknown-file) \
2> actual.info-unknown-file && 2> actual.info-unknown-file &&
grep unknown-file actual.info-unknown-file grep unknown-file actual.info-unknown-file
" "
test_expect_success 'info --url unknown-file' ' test_expect_success 'info --url unknown-file' '
echo two > gitwc/unknown-file && echo two > gitwc/unknown-file &&
(cd gitwc; test_must_fail git svn info --url unknown-file) \ (cd gitwc && test_must_fail git svn info --url unknown-file) \
2> actual.info-url-unknown-file && 2> actual.info-url-unknown-file &&
grep unknown-file actual.info-url-unknown-file grep unknown-file actual.info-url-unknown-file
' '
test_expect_success 'info unknown-directory' " test_expect_success 'info unknown-directory' "
mkdir gitwc/unknown-directory svnwc/unknown-directory && mkdir gitwc/unknown-directory svnwc/unknown-directory &&
(cd gitwc; test_must_fail git svn info unknown-directory) \ (cd gitwc && test_must_fail git svn info unknown-directory) \
2> actual.info-unknown-directory && 2> actual.info-unknown-directory &&
grep unknown-directory actual.info-unknown-directory grep unknown-directory actual.info-unknown-directory
" "
test_expect_success 'info --url unknown-directory' ' test_expect_success 'info --url unknown-directory' '
(cd gitwc; test_must_fail git svn info --url unknown-directory) \ (cd gitwc && test_must_fail git svn info --url unknown-directory) \
2> actual.info-url-unknown-directory && 2> actual.info-url-unknown-directory &&
grep unknown-directory actual.info-url-unknown-directory grep unknown-directory actual.info-url-unknown-directory
' '
@ -361,13 +361,13 @@ test_expect_success 'info unknown-symlink-file' "
cd gitwc && cd gitwc &&
ln -s unknown-file unknown-symlink-file ln -s unknown-file unknown-symlink-file
) && ) &&
(cd gitwc; test_must_fail git svn info unknown-symlink-file) \ (cd gitwc && test_must_fail git svn info unknown-symlink-file) \
2> actual.info-unknown-symlink-file && 2> actual.info-unknown-symlink-file &&
grep unknown-symlink-file actual.info-unknown-symlink-file grep unknown-symlink-file actual.info-unknown-symlink-file
" "
test_expect_success 'info --url unknown-symlink-file' ' test_expect_success 'info --url unknown-symlink-file' '
(cd gitwc; test_must_fail git svn info --url unknown-symlink-file) \ (cd gitwc && test_must_fail git svn info --url unknown-symlink-file) \
2> actual.info-url-unknown-symlink-file && 2> actual.info-url-unknown-symlink-file &&
grep unknown-symlink-file actual.info-url-unknown-symlink-file grep unknown-symlink-file actual.info-url-unknown-symlink-file
' '
@ -377,13 +377,13 @@ test_expect_success 'info unknown-symlink-directory' "
cd gitwc && cd gitwc &&
ln -s unknown-directory unknown-symlink-directory ln -s unknown-directory unknown-symlink-directory
) && ) &&
(cd gitwc; test_must_fail git svn info unknown-symlink-directory) \ (cd gitwc && test_must_fail git svn info unknown-symlink-directory) \
2> actual.info-unknown-symlink-directory && 2> actual.info-unknown-symlink-directory &&
grep unknown-symlink-directory actual.info-unknown-symlink-directory grep unknown-symlink-directory actual.info-unknown-symlink-directory
" "
test_expect_success 'info --url unknown-symlink-directory' ' test_expect_success 'info --url unknown-symlink-directory' '
(cd gitwc; test_must_fail git svn info --url unknown-symlink-directory) \ (cd gitwc && test_must_fail git svn info --url unknown-symlink-directory) \
2> actual.info-url-unknown-symlink-directory && 2> actual.info-url-unknown-symlink-directory &&
grep unknown-symlink-directory actual.info-url-unknown-symlink-directory grep unknown-symlink-directory actual.info-url-unknown-symlink-directory
' '

View File

@ -7,8 +7,8 @@ test_expect_success 'setup svn repository' '
svn_cmd checkout "$svnrepo" work.svn && svn_cmd checkout "$svnrepo" work.svn &&
( (
cd work.svn && cd work.svn &&
echo >file echo >file &&
svn_cmd add file svn_cmd add file &&
svn_cmd commit -m "first commit" file svn_cmd commit -m "first commit" file
) )
' '
@ -17,7 +17,7 @@ test_expect_success 'interact with it via git svn' '
mkdir work.git && mkdir work.git &&
( (
cd work.git && cd work.git &&
git svn init "$svnrepo" git svn init "$svnrepo" &&
git svn fetch && git svn fetch &&
echo modification >file && echo modification >file &&

View File

@ -51,7 +51,7 @@ do
git add F && git add F &&
git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt && git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") && E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
test "z$E" = "z$H" test "z$E" = "z$H" &&
compare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt compare_git_head_with "$TEST_DIRECTORY"/t3900/$H.txt
) )
' '

View File

@ -25,7 +25,7 @@ test_expect_success 'start import with incomplete authors file' '
test_expect_success 'imported 2 revisions successfully' ' test_expect_success 'imported 2 revisions successfully' '
( (
cd x cd x &&
git rev-list refs/remotes/git-svn >actual && git rev-list refs/remotes/git-svn >actual &&
test_line_count = 2 actual && test_line_count = 2 actual &&
git rev-list -1 --pretty=raw refs/remotes/git-svn >actual && git rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&
@ -42,7 +42,7 @@ EOF
test_expect_success 'continues to import once authors have been added' ' test_expect_success 'continues to import once authors have been added' '
( (
cd x cd x &&
git svn fetch --authors-file=../svn-authors && git svn fetch --authors-file=../svn-authors &&
git rev-list refs/remotes/git-svn >actual && git rev-list refs/remotes/git-svn >actual &&
test_line_count = 4 actual && test_line_count = 4 actual &&

View File

@ -82,7 +82,7 @@ test_expect_success 'update git svn-cloned repo (option ignore)' '
test_expect_success 'SVN-side change inside of ignored www' ' test_expect_success 'SVN-side change inside of ignored www' '
( (
cd s && cd s &&
echo zaq >> www/test_www.txt echo zaq >> www/test_www.txt &&
svn_cmd commit -m "SVN-side change inside of www/test_www.txt" && svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
svn_cmd up && svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt" svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
@ -114,8 +114,8 @@ test_expect_success 'update git svn-cloned repo (option ignore)' '
test_expect_success 'SVN-side change in and out of ignored www' ' test_expect_success 'SVN-side change in and out of ignored www' '
( (
cd s && cd s &&
echo cvf >> www/test_www.txt echo cvf >> www/test_www.txt &&
echo ygg >> qqq/test_qqq.txt echo ygg >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change in and out of ignored www" && svn_cmd commit -m "SVN-side change in and out of ignored www" &&
svn_cmd up && svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change in and out of ignored www" svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"

View File

@ -7,7 +7,7 @@ test_description='git svn dcommit clobber series'
test_expect_success 'initialize repo' ' test_expect_success 'initialize repo' '
mkdir import && mkdir import &&
(cd import && (cd import &&
awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file &&
svn_cmd import -m "initial" . "$svnrepo" svn_cmd import -m "initial" . "$svnrepo"
) && ) &&
git svn init "$svnrepo" && git svn init "$svnrepo" &&

View File

@ -38,7 +38,7 @@ test_expect_success 'import authors with prog and file' '
test_expect_success 'imported 6 revisions successfully' ' test_expect_success 'imported 6 revisions successfully' '
( (
cd x cd x &&
git rev-list refs/remotes/git-svn >actual && git rev-list refs/remotes/git-svn >actual &&
test_line_count = 6 actual test_line_count = 6 actual
) )
@ -46,7 +46,7 @@ test_expect_success 'imported 6 revisions successfully' '
test_expect_success 'authors-prog ran correctly' ' test_expect_success 'authors-prog ran correctly' '
( (
cd x cd x &&
git rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual && git rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&
grep "^author ee-foo <ee-foo@example\.com> " actual && grep "^author ee-foo <ee-foo@example\.com> " actual &&
git rev-list -1 --pretty=raw refs/remotes/git-svn~2 >actual && git rev-list -1 --pretty=raw refs/remotes/git-svn~2 >actual &&
@ -62,7 +62,7 @@ test_expect_success 'authors-prog ran correctly' '
test_expect_success 'authors-file overrode authors-prog' ' test_expect_success 'authors-file overrode authors-prog' '
( (
cd x cd x &&
git rev-list -1 --pretty=raw refs/remotes/git-svn >actual && git rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&
grep "^author FFFFFFF FFFFFFF <fFf@other\.example\.com> " actual grep "^author FFFFFFF FFFFFFF <fFf@other\.example\.com> " actual
) )

View File

@ -21,7 +21,7 @@ test_expect_success 'empty directories exist' '
do do
if ! test -d "$i" if ! test -d "$i"
then then
echo >&2 "$i does not exist" echo >&2 "$i does not exist" &&
exit 1 exit 1
fi fi
done done
@ -38,7 +38,7 @@ test_expect_success 'option automkdirs set to false' '
do do
if test -d "$i" if test -d "$i"
then then
echo >&2 "$i exists" echo >&2 "$i exists" &&
exit 1 exit 1
fi fi
done done
@ -63,7 +63,7 @@ test_expect_success 'git svn mkdirs recreates empty directories' '
do do
if ! test -d "$i" if ! test -d "$i"
then then
echo >&2 "$i does not exist" echo >&2 "$i does not exist" &&
exit 1 exit 1
fi fi
done done
@ -79,21 +79,21 @@ test_expect_success 'git svn mkdirs -r works' '
do do
if ! test -d "$i" if ! test -d "$i"
then then
echo >&2 "$i does not exist" echo >&2 "$i does not exist" &&
exit 1 exit 1
fi fi
done done &&
if test -d "! !" if test -d "! !"
then then
echo >&2 "$i should not exist" echo >&2 "$i should not exist" &&
exit 1 exit 1
fi fi &&
git svn mkdirs -r8 && git svn mkdirs -r8 &&
if ! test -d "! !" if ! test -d "! !"
then then
echo >&2 "$i not exist" echo >&2 "$i not exist" &&
exit 1 exit 1
fi fi
) )
@ -115,7 +115,7 @@ test_expect_success 'empty directories in trunk exist' '
do do
if ! test -d "$i" if ! test -d "$i"
then then
echo >&2 "$i does not exist" echo >&2 "$i does not exist" &&
exit 1 exit 1
fi fi
done done
@ -148,7 +148,7 @@ test_expect_success 'git svn gc-ed files work' '
do do
if ! test -d "$i" if ! test -d "$i"
then then
echo >&2 "$i does not exist" echo >&2 "$i does not exist" &&
exit 1 exit 1
fi fi
done done

View File

@ -84,7 +84,7 @@ test_expect_success 'update git svn-cloned repo (option include)' '
test_expect_success 'SVN-side change inside of ignored www' ' test_expect_success 'SVN-side change inside of ignored www' '
( (
cd s && cd s &&
echo zaq >> www/test_www.txt echo zaq >> www/test_www.txt &&
svn_cmd commit -m "SVN-side change inside of www/test_www.txt" && svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
svn_cmd up && svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt" svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
@ -116,8 +116,8 @@ test_expect_success 'update git svn-cloned repo (option include)' '
test_expect_success 'SVN-side change in and out of included qqq' ' test_expect_success 'SVN-side change in and out of included qqq' '
( (
cd s && cd s &&
echo cvf >> www/test_www.txt echo cvf >> www/test_www.txt &&
echo ygg >> qqq/test_qqq.txt echo ygg >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change in and out of ignored www" && svn_cmd commit -m "SVN-side change in and out of ignored www" &&
svn_cmd up && svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change in and out of ignored www" svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"

View File

@ -30,7 +30,7 @@ test_expect_success 'git svn mkdirs recreates empty directories after git svn gc
do do
if ! test -d "$i" if ! test -d "$i"
then then
echo >&2 "$i does not exist" echo >&2 "$i does not exist" &&
exit 1 exit 1
fi fi
done done

View File

@ -12,7 +12,7 @@ test_expect_success 'setup svn repository' '
svn_cmd checkout "$svnrepo" work.svn && svn_cmd checkout "$svnrepo" work.svn &&
( (
cd work.svn && cd work.svn &&
echo >file && echo > auto_updated_file echo >file && echo > auto_updated_file &&
svn_cmd add file auto_updated_file && svn_cmd add file auto_updated_file &&
svn_cmd commit -m "initial commit" svn_cmd commit -m "initial commit"
) && ) &&

View File

@ -39,7 +39,7 @@ test_expect_success 'initialize source svn repo' '
svn_cmd commit -m trunk && svn_cmd commit -m trunk &&
svn_cmd switch "$svnrepo"/branches/branch2 && svn_cmd switch "$svnrepo"/branches/branch2 &&
svn_cmd merge "$svnrepo"/trunk && svn_cmd merge "$svnrepo"/trunk &&
svn_cmd commit -m "merge trunk" svn_cmd commit -m "merge trunk" &&
svn_cmd switch "$svnrepo"/trunk && svn_cmd switch "$svnrepo"/trunk &&
svn_cmd merge --reintegrate "$svnrepo"/branches/branch2 && svn_cmd merge --reintegrate "$svnrepo"/branches/branch2 &&
svn_cmd commit -m "merge branch2" svn_cmd commit -m "merge branch2"

View File

@ -187,7 +187,7 @@ test_expect_success \
git commit -a -m "Update with spaces" && git commit -a -m "Update with spaces" &&
id=$(git rev-list --max-count=1 HEAD) && id=$(git rev-list --max-count=1 HEAD) &&
(cd "$CVSWORK" && (cd "$CVSWORK" &&
git cvsexportcommit -c $id git cvsexportcommit -c $id &&
check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/" check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
)' )'
@ -245,7 +245,7 @@ test_expect_success FILEMODE \
git add G/off && git add G/off &&
git commit -a -m "Execute test" && git commit -a -m "Execute test" &&
(cd "$CVSWORK" && (cd "$CVSWORK" &&
git cvsexportcommit -c HEAD git cvsexportcommit -c HEAD &&
test -x G/on && test -x G/on &&
! test -x G/off ! test -x G/off
)' )'
@ -303,7 +303,7 @@ test_expect_success 're-commit a removed filename which remains in CVS attic' '
git add attic_gremlin && git add attic_gremlin &&
git commit -m "Added attic_gremlin" && git commit -m "Added attic_gremlin" &&
git cvsexportcommit -w "$CVSWORK" -c HEAD && git cvsexportcommit -w "$CVSWORK" -c HEAD &&
(cd "$CVSWORK"; cvs -Q update -d) && (cd "$CVSWORK" && cvs -Q update -d) &&
test -f "$CVSWORK/attic_gremlin" test -f "$CVSWORK/attic_gremlin"
' '

View File

@ -80,7 +80,7 @@ test_expect_success 'lookups after checkpoint works' '
do do
if test $n -gt 30 if test $n -gt 30
then then
echo >&2 "checkpoint did not update branch" echo >&2 "checkpoint did not update branch" &&
exit 1 exit 1
else else
n=$(($n + 1)) n=$(($n + 1))

View File

@ -328,7 +328,7 @@ test_expect_success 'cvs update (subdirectories)' \
'(for dir in A A/B A/B/C A/D E; do '(for dir in A A/B A/B/C A/D E; do
mkdir $dir && mkdir $dir &&
echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" && echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" &&
git add $dir; git add $dir
done) && done) &&
git commit -q -m "deep sub directory structure" && git commit -q -m "deep sub directory structure" &&
git push gitcvs.git >/dev/null && git push gitcvs.git >/dev/null &&
@ -371,7 +371,7 @@ test_expect_success 'cvs update (merge)' \
'echo Line 0 >expected && 'echo Line 0 >expected &&
for i in 1 2 3 4 5 6 7 for i in 1 2 3 4 5 6 7
do do
echo Line $i >>merge echo Line $i >>merge &&
echo Line $i >>expected echo Line $i >>expected
done && done &&
echo Line 8 >>expected && echo Line 8 >>expected &&
@ -382,7 +382,7 @@ test_expect_success 'cvs update (merge)' \
GIT_CONFIG="$git_config" cvs -Q update && GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" && test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
test_cmp merge ../merge && test_cmp merge ../merge &&
( echo Line 0; cat merge ) >merge.tmp && ( echo Line 0 && cat merge ) >merge.tmp &&
mv merge.tmp merge && mv merge.tmp merge &&
cd "$WORKDIR" && cd "$WORKDIR" &&
echo Line 8 >>merge && echo Line 8 >>merge &&
@ -410,7 +410,7 @@ do
done done
test_expect_success 'cvs update (conflict merge)' \ test_expect_success 'cvs update (conflict merge)' \
'( echo LINE 0; cat merge ) >merge.tmp && '( echo LINE 0 && cat merge ) >merge.tmp &&
mv merge.tmp merge && mv merge.tmp merge &&
git add merge && git add merge &&
git commit -q -m "Merge test (conflict)" && git commit -q -m "Merge test (conflict)" &&

View File

@ -135,7 +135,7 @@ test_expect_success PERL 'second update has correct .git/cvs-revisions' '
(cd module-git && (cd module-git &&
git log --format="o_fortuna 1.1 %H" -1 HEAD^^ && git log --format="o_fortuna 1.1 %H" -1 HEAD^^ &&
git log --format="o_fortuna 1.2 %H" -1 HEAD^ git log --format="o_fortuna 1.2 %H" -1 HEAD^ &&
git log --format="tick 1.1 %H" -1 HEAD) > expected && git log --format="tick 1.1 %H" -1 HEAD) > expected &&
test_cmp expected module-git/.git/cvs-revisions test_cmp expected module-git/.git/cvs-revisions
' '

View File

@ -134,7 +134,7 @@ test_expect_success 'clone --changesfile' '
( (
cd "$git" && cd "$git" &&
git log --oneline p4/master >lines && git log --oneline p4/master >lines &&
test_line_count = 2 lines test_line_count = 2 lines &&
test_path_is_file file1 && test_path_is_file file1 &&
test_path_is_missing file2 && test_path_is_missing file2 &&
test_path_is_file file3 test_path_is_file file3

View File

@ -161,7 +161,7 @@ test_expect_success 'cleanup after failure' '
test_expect_success 'ktext expansion should not expand multi-line $File::' ' test_expect_success 'ktext expansion should not expand multi-line $File::' '
( (
cd "$cli" && cd "$cli" &&
cat >lv.pm <<-\EOF cat >lv.pm <<-\EOF &&
my $wanted = sub { my $f = $File::Find::name; my $wanted = sub { my $f = $File::Find::name;
if ( -f && $f =~ /foo/ ) { if ( -f && $f =~ /foo/ ) {
EOF EOF

View File

@ -133,7 +133,7 @@ test_expect_success 'export git tags to p4' '
p4 labels ... | grep LIGHTWEIGHT_TAG && p4 labels ... | grep LIGHTWEIGHT_TAG &&
p4 label -o GIT_TAG_1 | grep "tag created in git:xyzzy" && p4 label -o GIT_TAG_1 | grep "tag created in git:xyzzy" &&
p4 sync ...@GIT_TAG_1 && p4 sync ...@GIT_TAG_1 &&
! test -f main/f10 ! test -f main/f10 &&
p4 sync ...@GIT_TAG_2 && p4 sync ...@GIT_TAG_2 &&
test -f main/f10 test -f main/f10
) )

View File

@ -9,23 +9,11 @@ test_expect_success 'start p4d' '
' '
# We rely on this behavior to detect for p4 move availability. # We rely on this behavior to detect for p4 move availability.
test_expect_success 'p4 help unknown returns 1' ' test_expect_success '"p4 help unknown" errors out' '
( (
cd "$cli" && cd "$cli" &&
( p4 help client &&
p4 help client >errs 2>&1 ! p4 help nosuchcommand
echo $? >retval
)
echo 0 >expected &&
test_cmp expected retval &&
rm retval &&
(
p4 help nosuchcommand >errs 2>&1
echo $? >retval
)
echo 1 >expected &&
test_cmp expected retval &&
rm retval
) )
' '

View File

@ -394,7 +394,7 @@ test_expect_success 'cleanup rename after submit cancel' '
( (
cd "$cli" && cd "$cli" &&
test_path_is_missing text2 && test_path_is_missing text2 &&
p4 fstat -T action text2 2>&1 | grep "no such file" p4 fstat -T action text2 2>&1 | grep "no such file" &&
test_path_is_file text && test_path_is_file text &&
! p4 fstat -T action text ! p4 fstat -T action text
) )

Some files were not shown because too many files have changed in this diff Show More