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 &&
test_must_fail $command replace_sub1_with_file &&
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
)
'
@ -844,7 +844,7 @@ test_submodule_switch_recursing_with_args () {
cd submodule_update &&
git branch -t add_sub1 origin/add_sub1 &&
: >sub1 &&
echo sub1 >.git/info/exclude
echo sub1 >.git/info/exclude &&
$command add_sub1 &&
test_superproject_content 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 &&
$command replace_sub1_with_directory &&
test_superproject_content origin/replace_sub1_with_directory &&
test_submodule_content sub1 origin/modify_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 |
sed -e "s/ .*/ /" |
tr -d "\012"
tr -d "\012" &&
echo "$a"
) | git update-index --index-info &&
len=$(git ls-files "a*" | wc -c) &&

View file

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

View file

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

View file

@ -785,7 +785,7 @@ test_expect_success PERL 'missing file in delayed checkout' '
cd repo &&
git init &&
echo "*.a filter=bug" >.gitattributes &&
cp "$TEST_ROOT/test.o" missing-delay.a
cp "$TEST_ROOT/test.o" missing-delay.a &&
git add . &&
git commit -m "test commit"
) &&
@ -807,7 +807,7 @@ test_expect_success PERL 'invalid file in delayed checkout' '
git init &&
echo "*.a filter=bug" >.gitattributes &&
cp "$TEST_ROOT/test.o" invalid-delay.a &&
cp "$TEST_ROOT/test.o" unfiltered
cp "$TEST_ROOT/test.o" unfiltered &&
git add . &&
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;
}
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 &&
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 &&
git ls-files -u >actual &&
(
a=$(git rev-parse branch-point:subdir/file2)
b=$(git rev-parse side-a:subdir/file2/another)
echo "100644 $a 1 subdir/file2"
echo "100644 $a 2 subdir/file2"
a=$(git rev-parse branch-point:subdir/file2) &&
b=$(git rev-parse side-a:subdir/file2/another) &&
echo "100644 $a 1 subdir/file2" &&
echo "100644 $a 2 subdir/file2" &&
echo "100644 $b 3 subdir/file2/another"
) >expect &&
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 &&
sha1=$(git rev-parse :new) &&
(
echo "100644 $sha1 1 old"
echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old"
) | git update-index --index-info &&
>old &&
@ -48,7 +48,7 @@ test_expect_success 'two-way reset should remove remnants too' '
git ls-files -s >expect &&
sha1=$(git rev-parse :new) &&
(
echo "100644 $sha1 1 old"
echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old"
) | git update-index --index-info &&
>old &&
@ -63,7 +63,7 @@ test_expect_success 'Porcelain reset should remove remnants too' '
git ls-files -s >expect &&
sha1=$(git rev-parse :new) &&
(
echo "100644 $sha1 1 old"
echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old"
) | git update-index --index-info &&
>old &&
@ -78,7 +78,7 @@ test_expect_success 'Porcelain checkout -f should remove remnants too' '
git ls-files -s >expect &&
sha1=$(git rev-parse :new) &&
(
echo "100644 $sha1 1 old"
echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old"
) | git update-index --index-info &&
>old &&
@ -93,7 +93,7 @@ test_expect_success 'Porcelain checkout -f HEAD should remove remnants too' '
git ls-files -s >expect &&
sha1=$(git rev-parse :new) &&
(
echo "100644 $sha1 1 old"
echo "100644 $sha1 1 old" &&
echo "100644 $sha1 3 old"
) | git update-index --index-info &&
>old &&

View file

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

View file

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

View file

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

View file

@ -888,7 +888,7 @@ EOF
test_expect_success !MINGW 'get --path copes with unset $HOME' '
(
unset HOME;
sane_unset HOME &&
test_must_fail git config --get --path path.home \
>result 2>msg &&
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.two &&
(
cat log.one; echo
cat log.two; echo
cat log.one; echo
cat log.one && echo &&
cat log.two && echo &&
cat log.one && echo &&
cat log.two
) >expect &&
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' '
(
cd clone || exit
git checkout master || exit
git branch -D new ;# can fail but is ok
cd clone &&
git checkout master &&
test_might_fail git branch -D new &&
git branch -t new my-side@{u} &&
git merge -s ours new@{u} &&
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
do
echo $i
done
echo
done &&
echo &&
echo b1rwzyc3
) >a0blgqsjc &&
@ -222,7 +222,7 @@ test_expect_success 'more history' '
test_might_fail git rm -f a0blgqsjc &&
(
git cat-file blob $side:f5518nwu
git cat-file blob $side:f5518nwu &&
echo j3l0i9s6
) >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) &&
git update-ref HEAD "$commit" &&
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
'

View file

@ -20,33 +20,33 @@ test_expect_success PERL 'setup' '
test_expect_success PERL 'saying "n" does nothing' '
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 dir/foo
'
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_state dir/foo head head
'
test_expect_success PERL 'git checkout -p with staged changes' '
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_state dir/foo index index
'
test_expect_success PERL 'git checkout -p HEAD with NO staged changes: abort' '
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 dir/foo
'
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_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' '
set_state dir/foo index index &&
# 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_state dir/foo head head
'
test_expect_success PERL 'git checkout -p HEAD^' '
# 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_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' '
set_state dir/foo work index &&
rm dir/foo &&
(echo n; echo y) | git checkout -p &&
test_write_lines n y | git checkout -p &&
verify_saved_state bar &&
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' '
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_state dir/foo head head
'
test_expect_success PERL 'path limiting works: -- dir' '
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_state dir/foo head head
'
test_expect_success PERL 'path limiting works: HEAD^ -- dir' '
# 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_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' '
set_state dir/foo work head &&
# 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_state dir/foo head head
'

View file

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

View file

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

View file

@ -84,7 +84,7 @@ test_expect_success SYMLINKS 'ls-files --others with symlinked submodule' '
) &&
(
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
) &&
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" |
git update-index --add --index-info &&
(
echo "$path_a"
echo "$path_a" &&
echo "$path_z"
) >expect &&
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_seq $LAZY_THREAD_COST | sed "s/^/a_/"
echo b/b/b
test_seq $LAZY_THREAD_COST | sed "s/^/c_/"
test_seq 50 | sed "s/^/d_/" | tr "\n" "/"; echo d
test_seq $LAZY_THREAD_COST | sed "s/^/a_/" &&
echo b/b/b &&
test_seq $LAZY_THREAD_COST | sed "s/^/c_/" &&
test_seq 50 | sed "s/^/d_/" | tr "\n" "/" && echo d
) |
sed "s/^/100644 $EMPTY_BLOB /" |
git update-index --index-info &&

View file

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

View file

@ -21,10 +21,10 @@ test_expect_success setup '
test_expect_success clone '
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 &&
(git rev-parse HEAD; git ls-files -s) >../actual
(git rev-parse HEAD && git ls-files -s) >../actual
) &&
test_cmp expected actual
'
@ -40,11 +40,11 @@ test_expect_success advance '
'
test_expect_success fetch '
(git rev-parse HEAD; git ls-files -s) >expected &&
(git rev-parse HEAD && git ls-files -s) >expected &&
(
cd cloned &&
git pull &&
(git rev-parse HEAD; git ls-files -s) >../actual
(git rev-parse HEAD && git ls-files -s) >../actual
) &&
test_cmp expected actual
'

View file

@ -23,7 +23,7 @@ test_expect_success 'ls-tree outside prefix' '
cat >expect <<-EOF &&
100644 blob $EMPTY_BLOB ../a[a]/three
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
'

View file

@ -231,9 +231,9 @@ test_expect_success 'timeout if packed-refs.lock exists' '
test_expect_success 'retry acquiring packed-refs.lock' '
LOCK=.git/packed-refs.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
'

View file

@ -914,7 +914,7 @@ test_expect_success 'git notes copy --stdin' '
${indent}
${indent}yet another note
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)) |
git notes copy --stdin &&
git log -2 >actual &&
@ -939,7 +939,7 @@ test_expect_success 'git notes copy --for-rewrite (unconfigured)' '
EOF
test_commit 14th &&
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)) |
git notes copy --for-rewrite=foo &&
git log -2 >actual &&
@ -972,7 +972,7 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' '
EOF
test_config notes.rewriteMode overwrite &&
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)) |
git notes copy --for-rewrite=foo &&
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^^ &&
test_config notes.rewriteMode concatenate &&
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)) |
git notes copy --for-rewrite=foo &&
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' '
(
echo "One"
echo "TwoQ"
echo "Three"
echo "FQur"
echo "One" &&
echo "TwoQ" &&
echo "Three" &&
echo "FQur" &&
echo "Five"
) | q_to_cr >CR &&
git add CR &&

View file

@ -25,7 +25,7 @@ test_expect_success setup '
git commit -a -m"master updates a bit more." &&
git checkout side &&
(echo "0 $T" ; cat original) >renamed &&
(echo "0 $T" && cat original) >renamed &&
git add renamed &&
git update-index --force-remove original &&
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^ &&
test_commit funny &&
(
PATH=./test-bin:$PATH
PATH=./test-bin:$PATH &&
git rebase -s funny -Xopt master
) &&
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) &&
set_fake_editor &&
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 &&
test_must_fail git rebase --continue &&
echo resolved > conflict &&
@ -530,10 +530,10 @@ test_expect_success 'interrupted squash works as expected (case 2)' '
one=$(git rev-parse HEAD~3) &&
set_fake_editor &&
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 &&
test_must_fail git rebase --continue &&
(echo one; echo two; echo four) > conflict &&
test_write_lines one two four > conflict &&
git add conflict &&
test_must_fail git rebase --continue &&
echo resolved > conflict &&

View file

@ -60,7 +60,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
EOF
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 -f funny.was.run &&
@ -68,7 +68,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
echo "Resolved" >F2 &&
git add F2 &&
(
PATH=./test-bin:$PATH
PATH=./test-bin:$PATH &&
git rebase --continue
) &&
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' '
git rm --cached -f file symlink &&
(
echo "100644 $(git hash-object -w stage1) 1 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 $(git hash-object -w stage1) 1 file" &&
echo "100755 $(git hash-object -w stage2) 2 file" &&
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"
) | git update-index --index-info &&
git config core.filemode 0 &&
@ -265,7 +265,7 @@ test_expect_success 'git add to resolve conflicts on otherwise ignored path' '
git reset --hard &&
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"
) | git update-index --index-info &&
echo track-this >>.gitignore &&

View file

@ -46,13 +46,13 @@ test_expect_success 'setup expected' '
'
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 &&
diff_cmp expected diff
'
test_expect_success 'revert works (initial)' '
git add file &&
(echo r; echo 1) | git add -i &&
test_write_lines r 1 | git add -i &&
git ls-files >output &&
! grep . output
'
@ -83,13 +83,13 @@ test_expect_success 'setup expected' '
'
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 &&
diff_cmp expected diff
'
test_expect_success 'revert works (commit)' '
git add file &&
(echo r; echo 1) | git add -i &&
test_write_lines r 1 | git add -i &&
git add -i </dev/null >output &&
grep "unchanged *+3/-0 file" output
'
@ -102,7 +102,7 @@ test_expect_success 'setup expected' '
test_expect_success 'dummy edit works' '
test_set_editor : &&
(echo e; echo a) | git add -p &&
test_write_lines e a | git add -p &&
git diff > diff &&
diff_cmp expected diff
'
@ -127,7 +127,7 @@ test_expect_success 'setup fake editor' '
test_expect_success 'bad edit rejected' '
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
'
@ -140,7 +140,7 @@ test_expect_success 'setup patch' '
test_expect_success 'garbage edit rejected' '
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
'
@ -170,7 +170,7 @@ test_expect_success 'setup expected' '
'
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 &&
diff_cmp expected output
'

View file

@ -29,14 +29,14 @@ test_expect_success 'setup' '
test_expect_success 'saying "n" does nothing' '
set_state HEAD HEADfile_work HEADfile_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_saved_state bar &&
verify_state dir/foo work index
'
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_saved_state bar &&
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 bar bar_work bar_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 bar bar_work dummy &&
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 bar bar_work bar_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 dir/foo head head &&
verify_state bar bar_work dummy &&

View file

@ -180,7 +180,7 @@ test_expect_success 'setup for many rename source candidates' '
git add "path??" &&
test_tick &&
git commit -m "hundred" &&
(cat path1; echo new) >new-path &&
(cat path1 && echo new) >new-path &&
echo old >>path1 &&
git add new-path path1 &&
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_tick &&
git init submod &&
( cd submod && test_commit first; ) &&
( cd submod && test_commit first ) &&
git add submod &&
git commit -m first &&
( cd submod && test_commit second; ) &&
( cd submod && test_commit second ) &&
git add submod &&
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' '
echo Q | q_to_nul >binary &&
(: hide error code from diff, which just indicates differences
git diff --binary --no-index /dev/null binary >current ||
true
) &&
# hide error code from diff, which just indicates differences
test_might_fail git diff --binary --no-index /dev/null binary >current &&
rm binary &&
git apply --binary <current &&
echo Q >expected &&

View file

@ -127,17 +127,17 @@ test_expect_success setup '
for n in $sample
do
( zs $n ; echo a ) >file-a$n &&
( echo b; zs $n; echo ) >file-b$n &&
( printf c; zs $n ) >file-c$n &&
( echo d; zs $n ) >file-d$n &&
( zs $n && echo a ) >file-a$n &&
( echo b && zs $n && echo ) >file-b$n &&
( printf c && zs $n ) >file-c$n &&
( echo d && zs $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 &&
( echo B; zs $n; echo ) >file-b$n &&
( printf C; zs $n ) >file-c$n &&
( echo D; zs $n ) >file-d$n &&
( zs $n && echo A ) >file-a$n &&
( echo B && zs $n && echo ) >file-b$n &&
( printf C && zs $n ) >file-c$n &&
( echo D && zs $n ) >file-d$n &&
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 '
(
echo "A $NS"
echo "A $NS" &&
for c in B C D E F G H I J K
do
echo " $c"
done
echo "L $NS"
done &&
echo "L $NS" &&
for c in M N O P Q R S T U V
do
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 &&
(
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"
) >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' '
(cd sm2 &&
REAL="$(pwd)/../.real" &&
mv .git "$REAL"
mv .git "$REAL" &&
echo "gitdir: $REAL" >.git)
'
@ -527,7 +527,7 @@ test_expect_success 'diff --submodule with objects referenced by alternates' '
git commit -m "sub a"
) &&
(cd sub_alt &&
sha1_before=$(git rev-parse --short HEAD)
sha1_before=$(git rev-parse --short HEAD) &&
echo b >b &&
git add b &&
git commit -m b &&

View file

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

View file

@ -27,6 +27,6 @@ test_expect_success 'setup' \
test_expect_success \
'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

View file

@ -191,7 +191,7 @@ test_expect_success 'survive missing objects/pack directory' '
mkdir missing-pack &&
cd missing-pack &&
git init &&
GOP=.git/objects/pack
GOP=.git/objects/pack &&
rm -fr $GOP &&
git index-pack --stdin --keep=test <../test-3-${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/* &&
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
) &&
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' '
(
cd victim &&
( git branch -D extra || : ) &&
test_might_fail git branch -D extra &&
git config receive.denyDeletes true &&
git branch extra master
) &&
@ -119,7 +119,7 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
test_expect_success 'denyNonFastforwards trumps --force' '
(
cd victim &&
( git branch -D extra || : ) &&
test_might_fail git branch -D extra &&
git config receive.denyNonFastforwards true
) &&
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' '
(echo $commit0 $commit1 refs/heads/master;
(echo $commit0 $commit1 refs/heads/master &&
echo $commit1 $commit0 refs/heads/tofail
) | test_cmp - victim.git/pre-receive.stdin
'
test_expect_success 'update hook arguments' '
(echo refs/heads/master $commit0 $commit1;
(echo refs/heads/master $commit0 $commit1 &&
echo refs/heads/tofail $commit1 $commit0
) | test_cmp - victim.git/update.args
'

View file

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

View file

@ -6,8 +6,9 @@ test_description='remote push rejects are reported by client'
test_expect_success 'setup' '
mkdir .git/hooks &&
(echo "#!/bin/sh" ; echo "exit 1") >.git/hooks/update &&
chmod +x .git/hooks/update &&
write_script .git/hooks/update <<-\EOF &&
exit 1
EOF
echo 1 >file &&
git add file &&
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' '
(
cd shallow &&
git fetch --depth 4 .. A
git fetch --depth 4 .. A &&
test_must_fail git merge --allow-unrelated-histories FETCH_HEAD
)
'

View file

@ -348,17 +348,13 @@ URL: $(pwd)/one
EOF
test_expect_success 'prune --dry-run' '
(
cd one &&
git branch -m side2 side) &&
git -C one branch -m side2 side &&
test_when_finished "git -C one branch -m side side2" &&
(
cd test &&
git remote prune --dry-run origin >output &&
git rev-parse refs/remotes/origin/side2 &&
test_must_fail git rev-parse refs/remotes/origin/side &&
(
cd ../one &&
git branch -m side side2) &&
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 &&
test_path_is_missing .git/branches/origin &&
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"
)
'

View file

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

View file

@ -923,7 +923,7 @@ test_expect_success 'push into aliased refs (consistent)' '
(
cd child1 &&
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
) &&
(
@ -945,7 +945,7 @@ test_expect_success 'push into aliased refs (inconsistent)' '
(
cd child1 &&
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
) &&
(
@ -1011,7 +1011,7 @@ test_expect_success 'push --porcelain rejected' '
mk_empty testrepo &&
git push testrepo refs/heads/master:refs/remotes/origin/master &&
(cd testrepo &&
git reset --hard origin/master^
git reset --hard origin/master^ &&
git config receive.denyCurrentBranch true) &&
echo >.git/foo "To testrepo" &&
@ -1025,7 +1025,7 @@ test_expect_success 'push --porcelain --dry-run rejected' '
mk_empty testrepo &&
git push testrepo refs/heads/master:refs/remotes/origin/master &&
(cd testrepo &&
git reset --hard origin/master
git reset --hard origin/master &&
git config receive.denyCurrentBranch true) &&
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 tag -m "future" future &&
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
) &&
(

View file

@ -71,7 +71,7 @@ test_expect_success 'push mirror force updates existing branches' '
git push --mirror up &&
echo two >foo && git add foo && git commit -m two &&
git push --mirror up &&
git reset --hard HEAD^
git reset --hard HEAD^ &&
git push --mirror up
) &&
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 &&
git branch remove master &&
git push --mirror up &&
git branch -D remove
git branch -D remove &&
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 &&
git tag -f tmaster master &&
git push --mirror up &&
git reset --hard HEAD^
git reset --hard HEAD^ &&
git tag -f tmaster master &&
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 &&
git tag -f tremove master &&
git push --mirror up &&
git tag -d tremove
git tag -d tremove &&
git push --mirror up
) &&
(
@ -235,7 +235,7 @@ test_expect_success 'remote.foo.mirror adds and removes branches' '
git branch keep master &&
git branch remove master &&
git push up &&
git branch -D remove
git branch -D remove &&
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 fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err &&
git config --unset fetch.recurseSubmodules
git config --unset fetch.recurseSubmodules &&
(
cd submodule &&
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 &&
(
cd a1 &&
git init b
git init b &&
(
cd b &&
>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' '
mk_repo_pair &&
(
cd upstream
cd upstream &&
git config receive.advertiseatomic 0
) &&
(

View file

@ -618,7 +618,7 @@ hex2oct () {
test_expect_success 'clone on case-insensitive fs' '
git init icasefs &&
(
cd icasefs
cd icasefs &&
o=$(git hash-object -w --stdin </dev/null | hex2oct) &&
t=$(printf "100644 X\0${o}100644 x\0${o}" |
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 clone empty empty-clone &&
test_tick &&
(cd empty-clone
(cd empty-clone &&
echo "content" >> foo &&
git add foo &&
git commit -m "Initial commit" &&

View file

@ -23,7 +23,7 @@ test_expect_success CLONE_2GB 'setup' '
printf "blob\nmark :$i\ndata $blobsize\n" &&
#test-tool genrandom $i $blobsize &&
printf "%-${blobsize}s" $i &&
echo "M 100644 :$i $i" >> commit
echo "M 100644 :$i $i" >> commit &&
i=$(($i+1)) ||
echo $? > exit-status
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' '
(cd local &&
git checkout new-name
git checkout new-name &&
git push origin HEAD: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 rev-parse HEAD >derived$count &&
git checkout -B base $E || exit 1
done
done &&
for count in 1 2 3
do

View file

@ -55,7 +55,7 @@ test_expect_success 'initial merge' '
git checkout -b work &&
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"
) >expected &&
test_cmp expected actual
@ -72,7 +72,7 @@ test_expect_success 'merge update' '
git pull -s subtree gui master2 &&
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"
) >expected &&
test_cmp expected actual
@ -88,8 +88,8 @@ test_expect_success 'initial ambiguous subtree' '
git checkout -b work2 &&
git ls-files -s >actual &&
(
echo "100644 $o1 0 git-gui/git-gui.sh"
echo "100644 $o1 0 git-gui2/git-gui.sh"
echo "100644 $o1 0 git-gui/git-gui.sh" &&
echo "100644 $o1 0 git-gui2/git-gui.sh" &&
echo "100644 $o2 0 git.c"
) >expected &&
test_cmp expected actual
@ -101,8 +101,8 @@ test_expect_success 'merge using explicit' '
git pull -Xsubtree=git-gui gui master2 &&
git ls-files -s >actual &&
(
echo "100644 $o3 0 git-gui/git-gui.sh"
echo "100644 $o1 0 git-gui2/git-gui.sh"
echo "100644 $o3 0 git-gui/git-gui.sh" &&
echo "100644 $o1 0 git-gui2/git-gui.sh" &&
echo "100644 $o2 0 git.c"
) >expected &&
test_cmp expected actual
@ -114,8 +114,8 @@ test_expect_success 'merge2 using explicit' '
git pull -Xsubtree=git-gui2 gui master2 &&
git ls-files -s >actual &&
(
echo "100644 $o1 0 git-gui/git-gui.sh"
echo "100644 $o3 0 git-gui2/git-gui.sh"
echo "100644 $o1 0 git-gui/git-gui.sh" &&
echo "100644 $o3 0 git-gui2/git-gui.sh" &&
echo "100644 $o2 0 git.c"
) >expected &&
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 \
:2:three :3:three &&
git hash-object >>actual \
three~HEAD three~R2^0
three~HEAD three~R2^0 &&
test_cmp expect actual
)
'
@ -148,7 +148,7 @@ test_expect_success 'merge criss-cross + rename merges with basic modification'
git rev-parse >actual \
:2:three :3:three &&
git hash-object >>actual \
three~HEAD three~R2^0
three~HEAD three~R2^0 &&
test_cmp expect actual
)
'
@ -228,7 +228,7 @@ test_expect_success 'git detects differently handled merges conflict' '
D:new_a E:new_a &&
git rev-parse >actual \
: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 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 &&
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 \
: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
)
@ -604,10 +604,10 @@ test_expect_success 'merge of E2 & D1 fails but has appropriate contents' '
test_line_count = 2 out &&
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 \
: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
)

View file

@ -352,7 +352,7 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
base:file left-conflict:newfile right:file &&
git rev-parse >actual \
: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~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 &&
git rev-parse >actual \
: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 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 &&
git rev-parse >actual \
:1:a :2:b :3:b :2:c :3:c &&
test_cmp expect actual
test_cmp expect actual &&
git rev-parse >expect \
C:c B:c C:b B:b &&
git hash-object >actual \
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 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 &&
test_seq 1 10 >expected &&
echo stuff >>expected &&
test_cmp expected z/c
test_cmp expected z/c &&
git ls-files -s >out &&
test_line_count = 4 out &&

View file

@ -509,7 +509,7 @@ test_expect_success 'moving nested submodules' '
touch nested_level1 &&
git init &&
git add . &&
git commit -m "nested level 1"
git commit -m "nested level 1" &&
git submodule add ../sub_nested_nested &&
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' '
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 bar
'
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_saved_state bar &&
test_i18ngrep "Unstage" output
'
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_saved_state bar &&
test_i18ngrep "Apply" output
@ -45,20 +45,20 @@ test_expect_success PERL 'git reset -p HEAD^' '
test_expect_success PERL 'git reset -p dir' '
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_saved_state bar
'
test_expect_success PERL 'git reset -p -- foo (inside dir)' '
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_saved_state bar
'
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_saved_state bar
'

View file

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

View file

@ -107,7 +107,7 @@ test_expect_success 'git clean -id (filter all)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
(echo f; echo "*"; echo; echo c) | \
test_write_lines f "*" "" c |
git clean -id &&
test -f Makefile &&
test -f README &&
@ -129,7 +129,7 @@ test_expect_success 'git clean -id (filter patterns)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
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 &&
test -f Makefile &&
test -f README &&
@ -151,7 +151,7 @@ test_expect_success 'git clean -id (filter patterns 2)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
(echo f; echo "* !*.out"; echo; echo c) | \
test_write_lines f "* !*.out" "" c |
git clean -id &&
test -f Makefile &&
test -f README &&
@ -173,7 +173,7 @@ test_expect_success 'git clean -id (select - all)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
(echo s; echo "*"; echo; echo c) | \
test_write_lines s "*" "" c |
git clean -id &&
test -f Makefile &&
test -f README &&
@ -195,7 +195,7 @@ test_expect_success 'git clean -id (select - none)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
(echo s; echo; echo c) | \
test_write_lines s "" c |
git clean -id &&
test -f Makefile &&
test -f README &&
@ -217,7 +217,7 @@ test_expect_success 'git clean -id (select - number)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
(echo s; echo 3; echo; echo c) | \
test_write_lines s 3 "" c |
git clean -id &&
test -f Makefile &&
test -f README &&
@ -239,7 +239,7 @@ test_expect_success 'git clean -id (select - number 2)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
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 &&
test -f Makefile &&
test -f README &&
@ -261,7 +261,7 @@ test_expect_success 'git clean -id (select - number 3)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
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 &&
test -f Makefile &&
test -f README &&
@ -282,7 +282,7 @@ test_expect_success 'git clean -id (select - filenames)' '
mkdir -p build docs &&
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 &&
test -f Makefile &&
test ! -f a.out &&
@ -298,7 +298,7 @@ test_expect_success 'git clean -id (select - range)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
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 &&
test -f Makefile &&
test -f README &&
@ -320,7 +320,7 @@ test_expect_success 'git clean -id (select - range 2)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
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 &&
test -f Makefile &&
test -f README &&
@ -342,7 +342,7 @@ test_expect_success 'git clean -id (inverse select)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
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 &&
test -f Makefile &&
test -f README &&
@ -364,7 +364,7 @@ test_expect_success 'git clean -id (ask)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
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 &&
test -f Makefile &&
test -f README &&
@ -386,7 +386,7 @@ test_expect_success 'git clean -id (ask - Ctrl+D)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
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 &&
test -f Makefile &&
test -f README &&
@ -408,8 +408,8 @@ test_expect_success 'git clean -id with prefix and path (filter)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
(cd build/ && \
(echo f; echo "docs"; echo "*.h"; echo ; echo c) | \
(cd build/ &&
test_write_lines f docs "*.h" "" c |
git clean -id ..) &&
test -f Makefile &&
test -f README &&
@ -431,9 +431,8 @@ test_expect_success 'git clean -id with prefix and path (select by name)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
(cd build/ && \
(echo s; echo "../docs/"; echo "../src/part3.c"; \
echo "../src/part4.c"; echo; echo c) | \
(cd build/ &&
test_write_lines s ../docs/ ../src/part3.c ../src/part4.c "" c |
git clean -id ..) &&
test -f Makefile &&
test -f README &&
@ -455,8 +454,8 @@ test_expect_success 'git clean -id with prefix and path (ask)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
(cd build/ && \
(echo a; echo Y; echo y; echo no; echo yes; echo bad; echo) | \
(cd build/ &&
test_write_lines a Y y no yes bad "" |
git clean -id ..) &&
test -f Makefile &&
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' '
(
cd addtest-ignore &&
git submodule add --force bogus-url submod &&
git submodule add -b initial "$submodurl" submod-branch &&
test "bogus-url" = "$(git config -f .gitmodules submodule.submod.url)" &&
test "bogus-url" = "$(git config submodule.submod.url)" &&
bogus_url="$(pwd)/bogus-url" &&
git submodule add --force "$bogus_url" submod &&
git submodule add --force -b initial "$submodurl" submod-branch &&
test "$bogus_url" = "$(git config -f .gitmodules submodule.submod.url)" &&
test "$bogus_url" = "$(git config submodule.submod.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 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-.gitmodules .gitmodules &&
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 submodule add ../bar/a/b/c ./a/b/c &&
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 &&
git log > ../../expected
) &&
(cd .git/modules/submodule/modules/subsubmodule
(cd .git/modules/submodule/modules/subsubmodule &&
git log > ../../../../../actual
)
) &&
test_cmp actual expected
)
'
@ -886,7 +886,7 @@ test_expect_success 'submodule update properly revives a moved submodule' '
git commit -am "pre move" &&
H2=$(git rev-parse --short HEAD) &&
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 &&
rm -rf submodule2 &&
mkdir -p "moved/sub module" &&

View file

@ -148,7 +148,7 @@ test_expect_success 'preparing second superproject with a nested submodule plus
cd supersuper &&
echo "I am super super." >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 commit -m B-super-super-added &&
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' '
echo bong-o-bong >file &&
# 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 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" '
echo zoo >file &&
test_must_fail git diff --exit-code >diff1 &&
(echo u ; echo "*" ; echo q) |
test_write_lines u "*" q |
(
EDITOR=: &&
export EDITOR &&
@ -411,8 +411,8 @@ test_expect_success 'sign off (1)' '
git commit -s -m "thank you" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
(
echo thank you
echo
echo thank you &&
echo &&
git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected &&
@ -430,9 +430,9 @@ test_expect_success 'sign off (2)' '
$existing" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
(
echo thank you
echo
echo $existing
echo thank you &&
echo &&
echo $existing &&
git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected &&
@ -450,9 +450,9 @@ test_expect_success 'signoff gap' '
$alt" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
(
echo welcome
echo
echo $alt
echo welcome &&
echo &&
echo $alt &&
git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected &&
@ -470,11 +470,11 @@ We have now
$alt" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
(
echo welcome
echo
echo We have now
echo $alt
echo
echo welcome &&
echo &&
echo We have now &&
echo $alt &&
echo &&
git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected &&
@ -491,11 +491,11 @@ non-trailer line
Myfooter: x" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
(
echo subject
echo
echo non-trailer line
echo Myfooter: x
echo
echo subject &&
echo &&
echo non-trailer line &&
echo Myfooter: x &&
echo &&
echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
) >expected &&
test_cmp expected actual &&
@ -508,10 +508,10 @@ non-trailer line
Myfooter: x" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
(
echo subject
echo
echo non-trailer line
echo Myfooter: x
echo subject &&
echo &&
echo non-trailer line &&
echo Myfooter: x &&
echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
) >expected &&
test_cmp expected actual
@ -524,10 +524,10 @@ test_expect_success 'multiple -m' '
git commit -m "one" -m "two" -m "three" &&
git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
(
echo one
echo
echo two
echo
echo one &&
echo &&
echo two &&
echo &&
echo three
) >expected &&
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' '
(cd sub &&
rm -f new-file
rm -f new-file &&
REAL="$(pwd)/../.real" &&
mv .git "$REAL"
mv .git "$REAL" &&
echo "gitdir: $REAL" >.git) &&
echo .real >>.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' '
(
cd sub
cd sub &&
i=0 &&
while test $i -lt 1024
do
>some-file-$i
i=$(( $i + 1 ))
>some-file-$i &&
i=$(( $i + 1 )) || exit 1
done
) &&
git status --porcelain sub 2>err.actual &&

View file

@ -57,18 +57,18 @@ test_expect_success 'setup' '
git checkout -b delete-base branch1 &&
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 commit -m"base file" &&
git checkout -b move-to-b delete-base &&
mkdir -p b/b &&
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 checkout -b move-to-c delete-base &&
mkdir -p c/c &&
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 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 &&
test_config mergetool.keepTemporaries true &&
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 &&
cat >expect <<-\EOF &&
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)' '
mkdir -p s &&
(
cd s || exit 1
( git grep xxyyzz .. >out ; echo $? >status )
! test -s out &&
test 1 = $(cat status)
cd s &&
test_expect_code 1 git grep xxyyzz .. >out &&
! test -s out
)
'

View file

@ -332,7 +332,7 @@ test_expect_success $PREREQ 'Show all headers' '
test_expect_success $PREREQ 'Prompting works' '
clean_fake_sendmail &&
(echo "to@example.com"
(echo "to@example.com" &&
echo ""
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
--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' '
clean_fake_sendmail &&
(echo "From Example <from@example.com>"
echo "To Example <to@example.com>"
(echo "From Example <from@example.com>" &&
echo "To Example <to@example.com>" &&
echo ""
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
--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
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>" \
--to=nobody@example.com \
--smtp-server="$(pwd)/../fake.sendmail" \
../another.patch 2>err
../another.patch 2>err &&
test_i18ngrep "rejected by sendemail-validate hook" err
)
'

View file

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

View file

@ -149,7 +149,7 @@ test_expect_success 'test show-ignore' "
svn_cmd up &&
svn_cmd propset -R svn:ignore '
no-such-file*
' .
' . &&
svn_cmd commit -m 'propset svn:ignore'
) &&
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
# path most recently); do not expect that field to match.
test_cmp_info () {
sed -e '/^Text Last Updated:/d' "$1" >tmp.expect
sed -e '/^Text Last Updated:/d' "$2" >tmp.actual
sed -e '/^Text Last Updated:/d' "$1" >tmp.expect &&
sed -e '/^Text Last Updated:/d' "$2" >tmp.actual &&
test_cmp 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' "
(cd svnwc; svn info) > expected.info &&
(cd gitwc; git svn info) > actual.info &&
(cd svnwc && svn info) > expected.info &&
(cd gitwc && git svn info) > actual.info &&
test_cmp_info expected.info actual.info
"
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 .' "
(cd svnwc; svn info .) > expected.info-dot &&
(cd gitwc; git svn info .) > actual.info-dot &&
(cd svnwc && svn info .) > expected.info-dot &&
(cd gitwc && git svn info .) > actual.info-dot &&
test_cmp_info expected.info-dot actual.info-dot
"
test_expect_success 'info $(pwd)' '
(cd svnwc; svn info "$(pwd)") >expected.info-pwd &&
(cd gitwc; git svn info "$(pwd)") >actual.info-pwd &&
(cd svnwc && svn info "$(pwd)") >expected.info-pwd &&
(cd gitwc && git svn info "$(pwd)") >actual.info-pwd &&
grep -v ^Path: <expected.info-pwd >expected.info-np &&
grep -v ^Path: <actual.info-pwd >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' '
(cd svnwc; svn info "$(pwd)/../svnwc") >expected.info-pwd &&
(cd gitwc; git svn info "$(pwd)/../gitwc") >actual.info-pwd &&
(cd svnwc && svn info "$(pwd)/../svnwc") >expected.info-pwd &&
(cd gitwc && git svn info "$(pwd)/../gitwc") >actual.info-pwd &&
grep -v ^Path: <expected.info-pwd >expected.info-np &&
grep -v ^Path: <actual.info-pwd >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' '
(cd svnwc; svn info "$(pwd)/../svnwc//file") >expected.info-pwd &&
(cd gitwc; git svn info "$(pwd)/../gitwc//file") >actual.info-pwd &&
(cd svnwc && svn info "$(pwd)/../svnwc//file") >expected.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: <actual.info-pwd >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 "$(cd gitwc; git svn info --url .)" = "$quoted_svnrepo"
test "$(cd gitwc && git svn info --url .)" = "$quoted_svnrepo"
'
test_expect_success 'info file' "
(cd svnwc; svn info file) > expected.info-file &&
(cd gitwc; git svn info file) > actual.info-file &&
(cd svnwc && svn info file) > expected.info-file &&
(cd gitwc && git svn info file) > actual.info-file &&
test_cmp_info expected.info-file actual.info-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' "
(cd svnwc; svn info directory) > expected.info-directory &&
(cd gitwc; git svn info directory) > actual.info-directory &&
(cd svnwc && svn info directory) > expected.info-directory &&
(cd gitwc && git svn info directory) > actual.info-directory &&
test_cmp_info expected.info-directory actual.info-directory
"
test_expect_success 'info inside directory' "
(cd svnwc/directory; svn info) > expected.info-inside-directory &&
(cd gitwc/directory; git svn info) > actual.info-inside-directory &&
(cd svnwc/directory && svn info) > expected.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_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' "
(cd svnwc; svn info symlink-file) > expected.info-symlink-file &&
(cd gitwc; git svn info symlink-file) > actual.info-symlink-file &&
(cd svnwc && svn info symlink-file) > expected.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_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"
'
test_expect_success 'info symlink-directory' "
(cd svnwc; svn info symlink-directory) \
(cd svnwc && svn 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 &&
test_cmp_info expected.info-symlink-directory actual.info-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"
'
@ -169,13 +169,13 @@ test_expect_success 'info added-file' "
cd svnwc &&
svn_cmd add added-file > /dev/null
) &&
(cd svnwc; svn info added-file) > expected.info-added-file &&
(cd gitwc; git svn info added-file) > actual.info-added-file &&
(cd svnwc && svn info added-file) > expected.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_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"
'
@ -190,15 +190,15 @@ test_expect_success 'info added-directory' "
cd gitwc &&
git add added-directory
) &&
(cd svnwc; svn info added-directory) \
(cd svnwc && svn 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 &&
test_cmp_info expected.info-added-directory actual.info-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"
'
@ -213,16 +213,16 @@ test_expect_success 'info added-symlink-file' "
ln -s added-file added-symlink-file &&
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 &&
(cd gitwc; git svn info added-symlink-file) \
(cd gitwc && git svn info added-symlink-file) \
> actual.info-added-symlink-file &&
test_cmp_info expected.info-added-symlink-file \
actual.info-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"
'
@ -237,16 +237,16 @@ test_expect_success 'info added-symlink-directory' "
ln -s added-directory added-symlink-directory &&
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 &&
(cd gitwc; git svn info added-symlink-directory) \
(cd gitwc && git svn info added-symlink-directory) \
> actual.info-added-symlink-directory &&
test_cmp_info expected.info-added-symlink-directory \
actual.info-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"
'
@ -259,13 +259,13 @@ test_expect_success 'info deleted-file' "
cd svnwc &&
svn_cmd rm --force file > /dev/null
) &&
(cd svnwc; svn info file) >expected.info-deleted-file &&
(cd gitwc; git svn info file) >actual.info-deleted-file &&
(cd svnwc && svn info file) >expected.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_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"
'
@ -278,13 +278,13 @@ test_expect_success 'info deleted-directory' "
cd svnwc &&
svn_cmd rm --force directory > /dev/null
) &&
(cd svnwc; svn info directory) >expected.info-deleted-directory &&
(cd gitwc; git svn info directory) >actual.info-deleted-directory &&
(cd svnwc && svn info directory) >expected.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_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"
'
@ -297,13 +297,13 @@ test_expect_success 'info deleted-symlink-file' "
cd svnwc &&
svn_cmd rm --force symlink-file > /dev/null
) &&
(cd svnwc; svn info symlink-file) >expected.info-deleted-symlink-file &&
(cd gitwc; git svn info symlink-file) >actual.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 &&
test_cmp_info expected.info-deleted-symlink-file actual.info-deleted-symlink-file
"
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"
'
@ -316,13 +316,13 @@ test_expect_success 'info deleted-symlink-directory' "
cd svnwc &&
svn_cmd rm --force symlink-directory > /dev/null
) &&
(cd svnwc; svn info symlink-directory) >expected.info-deleted-symlink-directory &&
(cd gitwc; git svn info symlink-directory) >actual.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 &&
test_cmp_info expected.info-deleted-symlink-directory actual.info-deleted-symlink-directory
"
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"
'
@ -331,27 +331,27 @@ test_expect_success 'info --url symlink-directory (deleted)' '
test_expect_success 'info 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 &&
grep unknown-file actual.info-unknown-file
"
test_expect_success 'info --url 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 &&
grep unknown-file actual.info-url-unknown-file
'
test_expect_success 'info 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 &&
grep unknown-directory actual.info-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 &&
grep unknown-directory actual.info-url-unknown-directory
'
@ -361,13 +361,13 @@ test_expect_success 'info unknown-symlink-file' "
cd gitwc &&
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 &&
grep unknown-symlink-file actual.info-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 &&
grep unknown-symlink-file actual.info-url-unknown-symlink-file
'
@ -377,13 +377,13 @@ test_expect_success 'info unknown-symlink-directory' "
cd gitwc &&
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 &&
grep unknown-symlink-directory actual.info-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 &&
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 &&
(
cd work.svn &&
echo >file
svn_cmd add file
echo >file &&
svn_cmd add file &&
svn_cmd commit -m "first commit" file
)
'
@ -17,7 +17,7 @@ test_expect_success 'interact with it via git svn' '
mkdir work.git &&
(
cd work.git &&
git svn init "$svnrepo"
git svn init "$svnrepo" &&
git svn fetch &&
echo modification >file &&

View file

@ -51,7 +51,7 @@ do
git add F &&
git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
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
)
'

View file

@ -25,7 +25,7 @@ test_expect_success 'start import with incomplete authors file' '
test_expect_success 'imported 2 revisions successfully' '
(
cd x
cd x &&
git rev-list refs/remotes/git-svn >actual &&
test_line_count = 2 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' '
(
cd x
cd x &&
git svn fetch --authors-file=../svn-authors &&
git rev-list refs/remotes/git-svn >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' '
(
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 up &&
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' '
(
cd s &&
echo cvf >> www/test_www.txt
echo ygg >> qqq/test_qqq.txt
echo cvf >> www/test_www.txt &&
echo ygg >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change in and out of ignored www" &&
svn_cmd up &&
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' '
mkdir 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"
) &&
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' '
(
cd x
cd x &&
git rev-list refs/remotes/git-svn >actual &&
test_line_count = 6 actual
)
@ -46,7 +46,7 @@ test_expect_success 'imported 6 revisions successfully' '
test_expect_success 'authors-prog ran correctly' '
(
cd x
cd x &&
git rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&
grep "^author ee-foo <ee-foo@example\.com> " 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' '
(
cd x
cd x &&
git rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&
grep "^author FFFFFFF FFFFFFF <fFf@other\.example\.com> " actual
)

View file

@ -21,7 +21,7 @@ test_expect_success 'empty directories exist' '
do
if ! test -d "$i"
then
echo >&2 "$i does not exist"
echo >&2 "$i does not exist" &&
exit 1
fi
done
@ -38,7 +38,7 @@ test_expect_success 'option automkdirs set to false' '
do
if test -d "$i"
then
echo >&2 "$i exists"
echo >&2 "$i exists" &&
exit 1
fi
done
@ -63,7 +63,7 @@ test_expect_success 'git svn mkdirs recreates empty directories' '
do
if ! test -d "$i"
then
echo >&2 "$i does not exist"
echo >&2 "$i does not exist" &&
exit 1
fi
done
@ -79,21 +79,21 @@ test_expect_success 'git svn mkdirs -r works' '
do
if ! test -d "$i"
then
echo >&2 "$i does not exist"
echo >&2 "$i does not exist" &&
exit 1
fi
done
done &&
if test -d "! !"
then
echo >&2 "$i should not exist"
echo >&2 "$i should not exist" &&
exit 1
fi
fi &&
git svn mkdirs -r8 &&
if ! test -d "! !"
then
echo >&2 "$i not exist"
echo >&2 "$i not exist" &&
exit 1
fi
)
@ -115,7 +115,7 @@ test_expect_success 'empty directories in trunk exist' '
do
if ! test -d "$i"
then
echo >&2 "$i does not exist"
echo >&2 "$i does not exist" &&
exit 1
fi
done
@ -148,7 +148,7 @@ test_expect_success 'git svn gc-ed files work' '
do
if ! test -d "$i"
then
echo >&2 "$i does not exist"
echo >&2 "$i does not exist" &&
exit 1
fi
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' '
(
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 up &&
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' '
(
cd s &&
echo cvf >> www/test_www.txt
echo ygg >> qqq/test_qqq.txt
echo cvf >> www/test_www.txt &&
echo ygg >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change in and out of ignored www" &&
svn_cmd up &&
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
if ! test -d "$i"
then
echo >&2 "$i does not exist"
echo >&2 "$i does not exist" &&
exit 1
fi
done

View file

@ -12,7 +12,7 @@ test_expect_success 'setup svn repository' '
svn_cmd checkout "$svnrepo" 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 commit -m "initial commit"
) &&

View file

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

View file

@ -187,7 +187,7 @@ test_expect_success \
git commit -a -m "Update with spaces" &&
id=$(git rev-list --max-count=1 HEAD) &&
(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/"
)'
@ -245,7 +245,7 @@ test_expect_success FILEMODE \
git add G/off &&
git commit -a -m "Execute test" &&
(cd "$CVSWORK" &&
git cvsexportcommit -c HEAD
git cvsexportcommit -c HEAD &&
test -x G/on &&
! 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 commit -m "Added attic_gremlin" &&
git cvsexportcommit -w "$CVSWORK" -c HEAD &&
(cd "$CVSWORK"; cvs -Q update -d) &&
(cd "$CVSWORK" && cvs -Q update -d) &&
test -f "$CVSWORK/attic_gremlin"
'

View file

@ -80,7 +80,7 @@ test_expect_success 'lookups after checkpoint works' '
do
if test $n -gt 30
then
echo >&2 "checkpoint did not update branch"
echo >&2 "checkpoint did not update branch" &&
exit 1
else
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
mkdir $dir &&
echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" &&
git add $dir;
git add $dir
done) &&
git commit -q -m "deep sub directory structure" &&
git push gitcvs.git >/dev/null &&
@ -371,7 +371,7 @@ test_expect_success 'cvs update (merge)' \
'echo Line 0 >expected &&
for i in 1 2 3 4 5 6 7
do
echo Line $i >>merge
echo Line $i >>merge &&
echo Line $i >>expected
done &&
echo Line 8 >>expected &&
@ -382,7 +382,7 @@ test_expect_success 'cvs update (merge)' \
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
test_cmp merge ../merge &&
( echo Line 0; cat merge ) >merge.tmp &&
( echo Line 0 && cat merge ) >merge.tmp &&
mv merge.tmp merge &&
cd "$WORKDIR" &&
echo Line 8 >>merge &&
@ -410,7 +410,7 @@ do
done
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 &&
git add merge &&
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 &&
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 &&
test_cmp expected module-git/.git/cvs-revisions
'

View file

@ -134,7 +134,7 @@ test_expect_success 'clone --changesfile' '
(
cd "$git" &&
git log --oneline p4/master >lines &&
test_line_count = 2 lines
test_line_count = 2 lines &&
test_path_is_file file1 &&
test_path_is_missing file2 &&
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::' '
(
cd "$cli" &&
cat >lv.pm <<-\EOF
cat >lv.pm <<-\EOF &&
my $wanted = sub { my $f = $File::Find::name;
if ( -f && $f =~ /foo/ ) {
EOF

View file

@ -133,7 +133,7 @@ test_expect_success 'export git tags to p4' '
p4 labels ... | grep LIGHTWEIGHT_TAG &&
p4 label -o GIT_TAG_1 | grep "tag created in git:xyzzy" &&
p4 sync ...@GIT_TAG_1 &&
! test -f main/f10
! test -f main/f10 &&
p4 sync ...@GIT_TAG_2 &&
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.
test_expect_success 'p4 help unknown returns 1' '
test_expect_success '"p4 help unknown" errors out' '
(
cd "$cli" &&
(
p4 help client >errs 2>&1
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
p4 help client &&
! p4 help nosuchcommand
)
'

View file

@ -394,7 +394,7 @@ test_expect_success 'cleanup rename after submit cancel' '
(
cd "$cli" &&
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 &&
! p4 fstat -T action text
)

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