Browse Source

tests: use "git xyzzy" form (t3600 - t6999)

Converts tests between t3600-t6300.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Nanako Shiraishi 17 years ago committed by Junio C Hamano
parent
commit
3604e7c5c6
  1. 4
      t/t3600-rm.sh
  2. 4
      t/t4012-diff-binary.sh
  3. 26
      t/t4103-apply-binary.sh
  4. 2
      t/t4124-apply-ws-rule.sh
  5. 4
      t/t4127-apply-same-fn.sh
  6. 2
      t/t4150-am.sh
  7. 4
      t/t4151-am-abort.sh
  8. 16
      t/t5300-pack-object.sh
  9. 4
      t/t5301-sliding-window.sh
  10. 12
      t/t5302-pack-index.sh
  11. 2
      t/t5305-include-tag.sh
  12. 30
      t/t5400-send-pack.sh
  13. 4
      t/t5401-update-hooks.sh
  14. 4
      t/t5402-post-merge-hook.sh
  15. 4
      t/t5403-post-checkout-hook.sh
  16. 4
      t/t5500-fetch-pack.sh
  17. 2
      t/t5510-fetch.sh
  18. 4
      t/t5530-upload-pack-error.sh
  19. 12
      t/t5600-clone-fail-cleanup.sh
  20. 4
      t/t5602-clone-remote-exec.sh
  21. 6
      t/t6006-rev-list-format.sh
  22. 32
      t/t6025-merge-symlinks.sh
  23. 12
      t/t6026-merge-attr.sh
  24. 4
      t/t6030-bisect-porcelain.sh
  25. 30
      t/t6120-describe.sh
  26. 28
      t/t6300-for-each-ref.sh

4
t/t3600-rm.sh

@ -12,14 +12,14 @@ test_expect_success \ @@ -12,14 +12,14 @@ test_expect_success \
'Initialize test directory' \
"touch -- foo bar baz 'space embedded' -q &&
git add -- foo bar baz 'space embedded' -q &&
git-commit -m 'add normal files' &&
git commit -m 'add normal files' &&
test_tabs=y &&
if touch -- 'tab embedded' 'newline
embedded'
then
git add -- 'tab embedded' 'newline
embedded' &&
git-commit -m 'add files with tabs and newlines'
git commit -m 'add files with tabs and newlines'
else
say 'Your filesystem does not allow tabs in filenames.'
test_tabs=n

4
t/t4012-diff-binary.sh

@ -61,7 +61,7 @@ test_expect_success 'apply detecting corrupt patch correctly' \ @@ -61,7 +61,7 @@ test_expect_success 'apply detecting corrupt patch correctly' \
detected=`sed -ne "${detected}p" broken` &&
test "$detected" = xCIT'

test_expect_success 'initial commit' 'git-commit -a -m initial'
test_expect_success 'initial commit' 'git commit -a -m initial'

# Try removal (b), modification (d), and creation (e).
test_expect_success 'diff-index with --binary' \
@ -72,7 +72,7 @@ test_expect_success 'diff-index with --binary' \ @@ -72,7 +72,7 @@ test_expect_success 'diff-index with --binary' \
git apply --stat --summary current'

test_expect_success 'apply binary patch' \
'git-reset --hard &&
'git reset --hard &&
git apply --binary --index <current &&
tree1=`git write-tree` &&
test "$tree1" = "$tree0"'

26
t/t4103-apply-binary.sh

@ -21,16 +21,16 @@ cat file1 >file2 @@ -21,16 +21,16 @@ cat file1 >file2
cat file1 >file4

git update-index --add --remove file1 file2 file4
git-commit -m 'Initial Version' 2>/dev/null
git commit -m 'Initial Version' 2>/dev/null

git-checkout -b binary
git checkout -b binary
perl -pe 'y/x/\000/' <file1 >file3
cat file3 >file4
git add file2
perl -pe 'y/\000/v/' <file3 >file1
rm -f file2
git update-index --add --remove file1 file2 file3 file4
git-commit -m 'Second Version'
git commit -m 'Second Version'

git diff-tree -p master binary >B.diff
git diff-tree -p -C master binary >C.diff
@ -39,47 +39,47 @@ git diff-tree -p --binary master binary >BF.diff @@ -39,47 +39,47 @@ git diff-tree -p --binary master binary >BF.diff
git diff-tree -p --binary -C master binary >CF.diff

test_expect_success 'stat binary diff -- should not fail.' \
'git-checkout master
'git checkout master
git apply --stat --summary B.diff'

test_expect_success 'stat binary diff (copy) -- should not fail.' \
'git-checkout master
'git checkout master
git apply --stat --summary C.diff'

test_expect_success 'check binary diff -- should fail.' \
'git-checkout master &&
'git checkout master &&
test_must_fail git apply --check B.diff'

test_expect_success 'check binary diff (copy) -- should fail.' \
'git-checkout master &&
'git checkout master &&
test_must_fail git apply --check C.diff'

test_expect_success \
'check incomplete binary diff with replacement -- should fail.' '
git-checkout master &&
git checkout master &&
test_must_fail git apply --check --allow-binary-replacement B.diff
'

test_expect_success \
'check incomplete binary diff with replacement (copy) -- should fail.' '
git-checkout master &&
git checkout master &&
test_must_fail git apply --check --allow-binary-replacement C.diff
'

test_expect_success 'check binary diff with replacement.' \
'git-checkout master
'git checkout master
git apply --check --allow-binary-replacement BF.diff'

test_expect_success 'check binary diff with replacement (copy).' \
'git-checkout master
'git checkout master
git apply --check --allow-binary-replacement CF.diff'

# Now we start applying them.

do_reset () {
rm -f file? &&
git-reset --hard &&
git-checkout -f master
git reset --hard &&
git checkout -f master
}

test_expect_success 'apply binary diff -- should fail.' \

2
t/t4124-apply-ws-rule.sh

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!/bin/sh

test_description='core.whitespace rules and git-apply'
test_description='core.whitespace rules and git apply'

. ./test-lib.sh


4
t/t4127-apply-same-fn.sh

@ -26,7 +26,7 @@ test_expect_success 'apply same filename with independent changes' ' @@ -26,7 +26,7 @@ test_expect_success 'apply same filename with independent changes' '
git diff >> patch0 &&
cp same_fn same_fn2 &&
git reset --hard &&
git-apply patch0 &&
git apply patch0 &&
diff same_fn same_fn2
'

@ -39,7 +39,7 @@ test_expect_success 'apply same filename with overlapping changes' ' @@ -39,7 +39,7 @@ test_expect_success 'apply same filename with overlapping changes' '
git diff >> patch0 &&
cp same_fn same_fn2 &&
git reset --hard &&
git-apply patch0 &&
git apply patch0 &&
diff same_fn same_fn2
'


2
t/t4150-am.sh

@ -164,7 +164,7 @@ test_expect_success 'am --keep really keeps the subject' ' @@ -164,7 +164,7 @@ test_expect_success 'am --keep really keeps the subject' '
git checkout HEAD^ &&
git am --keep patch4 &&
! test -d .git/rebase-apply &&
git-cat-file commit HEAD |
git cat-file commit HEAD |
grep -q -F "Re: Re: Re: [PATCH 1/5 v2] third"
'


4
t/t4151-am-abort.sh

@ -44,14 +44,14 @@ do @@ -44,14 +44,14 @@ do
'

test_expect_success "am$with3 --skip continue after failed am$with3" '
test_must_fail git-am$with3 --skip >output &&
test_must_fail git am$with3 --skip >output &&
test "$(grep "^Applying" output)" = "Applying: 6" &&
test_cmp file-2-expect file-2 &&
test ! -f .git/rr-cache/MERGE_RR
'

test_expect_success "am --abort goes back after failed am$with3" '
git-am --abort &&
git am --abort &&
git rev-parse HEAD >actual &&
git rev-parse initial >expect &&
test_cmp expect actual &&

16
t/t5300-pack-object.sh

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Copyright (c) 2005 Junio C Hamano
#

test_description='git-pack-object
test_description='git pack-object

'
. ./test-lib.sh
@ -236,24 +236,24 @@ test_expect_success \ @@ -236,24 +236,24 @@ test_expect_success \
test_expect_success \
'build pack index for an existing pack' \
'cat test-1-${packname_1}.pack >test-3.pack &&
git-index-pack -o tmp.idx test-3.pack &&
git index-pack -o tmp.idx test-3.pack &&
cmp tmp.idx test-1-${packname_1}.idx &&

git-index-pack test-3.pack &&
git index-pack test-3.pack &&
cmp test-3.idx test-1-${packname_1}.idx &&

cat test-2-${packname_2}.pack >test-3.pack &&
git-index-pack -o tmp.idx test-2-${packname_2}.pack &&
git index-pack -o tmp.idx test-2-${packname_2}.pack &&
cmp tmp.idx test-2-${packname_2}.idx &&

git-index-pack test-3.pack &&
git index-pack test-3.pack &&
cmp test-3.idx test-2-${packname_2}.idx &&

cat test-3-${packname_3}.pack >test-3.pack &&
git-index-pack -o tmp.idx test-3-${packname_3}.pack &&
git index-pack -o tmp.idx test-3-${packname_3}.pack &&
cmp tmp.idx test-3-${packname_3}.idx &&

git-index-pack test-3.pack &&
git index-pack test-3.pack &&
cmp test-3.idx test-3-${packname_3}.idx &&

:'
@ -266,7 +266,7 @@ test_expect_success \ @@ -266,7 +266,7 @@ test_expect_success \

test_expect_success \
'make sure index-pack detects the SHA1 collision' \
'test_must_fail git-index-pack -o bad.idx test-3.pack'
'test_must_fail git index-pack -o bad.idx test-3.pack'

test_expect_success \
'honor pack.packSizeLimit' \

4
t/t5301-sliding-window.sh

@ -19,7 +19,7 @@ test_expect_success \ @@ -19,7 +19,7 @@ test_expect_success \
tree=`git write-tree` &&
commit1=`git commit-tree $tree </dev/null` &&
git update-ref HEAD $commit1 &&
git-repack -a -d &&
git repack -a -d &&
test "`git count-objects`" = "0 objects, 0 kilobytes" &&
pack1=`ls .git/objects/pack/*.pack` &&
test -f "$pack1"'
@ -45,7 +45,7 @@ test_expect_success \ @@ -45,7 +45,7 @@ test_expect_success \
git config core.packedGitLimit 512 &&
commit2=`git commit-tree $tree -p $commit1 </dev/null` &&
git update-ref HEAD $commit2 &&
git-repack -a -d &&
git repack -a -d &&
test "`git count-objects`" = "0 objects, 0 kilobytes" &&
pack2=`ls .git/objects/pack/*.pack` &&
test -f "$pack2"

12
t/t5302-pack-index.sh

@ -48,11 +48,11 @@ test_expect_success \ @@ -48,11 +48,11 @@ test_expect_success \

test_expect_success \
'index-pack with index version 1' \
'git-index-pack --index-version=1 -o 1.idx "test-1-${pack1}.pack"'
'git index-pack --index-version=1 -o 1.idx "test-1-${pack1}.pack"'

test_expect_success \
'index-pack with index version 2' \
'git-index-pack --index-version=2 -o 2.idx "test-1-${pack1}.pack"'
'git index-pack --index-version=2 -o 2.idx "test-1-${pack1}.pack"'

test_expect_success \
'index-pack results should match pack-objects ones' \
@ -85,7 +85,7 @@ test_expect_success \ @@ -85,7 +85,7 @@ test_expect_success \
test "$have_64bits" &&
test_expect_success \
'index v2: force some 64-bit offsets with index-pack' \
'git-index-pack --index-version=2,0x40000 -o 3.idx "test-1-${pack1}.pack"'
'git index-pack --index-version=2,0x40000 -o 3.idx "test-1-${pack1}.pack"'

test "$have_64bits" &&
test_expect_success \
@ -94,7 +94,7 @@ test_expect_success \ @@ -94,7 +94,7 @@ test_expect_success \

test_expect_success \
'[index v1] 1) stream pack to repository' \
'git-index-pack --index-version=1 --stdin < "test-1-${pack1}.pack" &&
'git index-pack --index-version=1 --stdin < "test-1-${pack1}.pack" &&
git prune-packed &&
git count-objects | ( read nr rest && test "$nr" -eq 1 ) &&
cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" &&
@ -132,7 +132,7 @@ test_expect_success \ @@ -132,7 +132,7 @@ test_expect_success \
test_expect_success \
'[index v2] 1) stream pack to repository' \
'rm -f .git/objects/pack/* &&
git-index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git prune-packed &&
git count-objects | ( read nr rest && test "$nr" -eq 1 ) &&
cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" &&
@ -165,7 +165,7 @@ test_expect_success \ @@ -165,7 +165,7 @@ test_expect_success \
test_expect_success \
'[index v2] 6) verify-pack detects CRC mismatch' \
'rm -f .git/objects/pack/* &&
git-index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git verify-pack ".git/objects/pack/pack-${pack1}.pack" &&
chmod +w ".git/objects/pack/pack-${pack1}.idx" &&
dd if=/dev/zero of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \

2
t/t5305-include-tag.sh

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!/bin/sh

test_description='git-pack-object --include-tag'
test_description='git pack-object --include-tag'
. ./test-lib.sh

TRASH=`pwd`

30
t/t5400-send-pack.sh

@ -31,7 +31,7 @@ test_expect_success setup ' @@ -31,7 +31,7 @@ test_expect_success setup '
parent=$commit || return 1
done &&
git update-ref HEAD "$commit" &&
git-clone ./. victim &&
git clone ./. victim &&
cd victim &&
git log &&
cd .. &&
@ -68,7 +68,7 @@ test_expect_success 'pack the destination repository' ' @@ -68,7 +68,7 @@ test_expect_success 'pack the destination repository' '
test_expect_success \
'pushing rewound head should not barf but require --force' '
# should not fail but refuse to update.
if git-send-pack ./victim/.git/ master
if git send-pack ./victim/.git/ master
then
# now it should fail with Pasky patch
echo >&2 Gaah, it should have failed.
@ -85,7 +85,7 @@ test_expect_success \ @@ -85,7 +85,7 @@ test_expect_success \
true
fi &&
# this should update
git-send-pack --force ./victim/.git/ master &&
git send-pack --force ./victim/.git/ master &&
cmp victim/.git/refs/heads/master .git/refs/heads/master
'

@ -95,7 +95,7 @@ test_expect_success \ @@ -95,7 +95,7 @@ test_expect_success \
git branch extra master &&
cd .. &&
test -f victim/.git/refs/heads/extra &&
git-send-pack ./victim/.git/ :extra master &&
git send-pack ./victim/.git/ :extra master &&
! test -f victim/.git/refs/heads/extra
'

@ -109,27 +109,27 @@ test_expect_success \ @@ -109,27 +109,27 @@ test_expect_success \
git config receive.denyNonFastforwards true &&
cd .. &&
git update-ref refs/heads/master master^ || return 1
git-send-pack --force ./victim/.git/ master && return 1
git send-pack --force ./victim/.git/ master && return 1
! test_cmp .git/refs/heads/master victim/.git/refs/heads/master
'

test_expect_success \
'pushing does not include non-head refs' '
mkdir parent && cd parent &&
git-init && touch file && git-add file && git-commit -m add &&
git init && touch file && git add file && git commit -m add &&
cd .. &&
git-clone parent child && cd child && git-push --all &&
git clone parent child && cd child && git push --all &&
cd ../parent &&
git-branch -a >branches && ! grep origin/master branches
git branch -a >branches && ! grep origin/master branches
'

rewound_push_setup() {
rm -rf parent child &&
mkdir parent && cd parent &&
git-init && echo one >file && git-add file && git-commit -m one &&
echo two >file && git-commit -a -m two &&
git init && echo one >file && git add file && git commit -m one &&
echo two >file && git commit -a -m two &&
cd .. &&
git-clone parent child && cd child && git-reset --hard HEAD^
git clone parent child && cd child && git reset --hard HEAD^
}

rewound_push_succeeded() {
@ -148,26 +148,26 @@ rewound_push_failed() { @@ -148,26 +148,26 @@ rewound_push_failed() {
test_expect_success \
'pushing explicit refspecs respects forcing' '
rewound_push_setup &&
if git-send-pack ../parent/.git refs/heads/master:refs/heads/master
if git send-pack ../parent/.git refs/heads/master:refs/heads/master
then
false
else
true
fi && rewound_push_failed &&
git-send-pack ../parent/.git +refs/heads/master:refs/heads/master &&
git send-pack ../parent/.git +refs/heads/master:refs/heads/master &&
rewound_push_succeeded
'

test_expect_success \
'pushing wildcard refspecs respects forcing' '
rewound_push_setup &&
if git-send-pack ../parent/.git refs/heads/*:refs/heads/*
if git send-pack ../parent/.git refs/heads/*:refs/heads/*
then
false
else
true
fi && rewound_push_failed &&
git-send-pack ../parent/.git +refs/heads/*:refs/heads/* &&
git send-pack ../parent/.git +refs/heads/*:refs/heads/* &&
rewound_push_succeeded
'


4
t/t5401-update-hooks.sh

@ -17,7 +17,7 @@ test_expect_success setup ' @@ -17,7 +17,7 @@ test_expect_success setup '
commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
git update-ref refs/heads/master $commit0 &&
git update-ref refs/heads/tofail $commit1 &&
git-clone ./. victim &&
git clone ./. victim &&
GIT_DIR=victim/.git git update-ref refs/heads/tofail $commit1 &&
git update-ref refs/heads/master $commit1 &&
git update-ref refs/heads/tofail $commit0
@ -61,7 +61,7 @@ EOF @@ -61,7 +61,7 @@ EOF
chmod u+x victim/.git/hooks/post-update

test_expect_success push '
test_must_fail git-send-pack --force ./victim/.git \
test_must_fail git send-pack --force ./victim/.git \
master tofail >send.out 2>send.err
'


4
t/t5402-post-merge-hook.sh

@ -16,9 +16,9 @@ test_expect_success setup ' @@ -16,9 +16,9 @@ test_expect_success setup '
tree1=$(git write-tree) &&
commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
git update-ref refs/heads/master $commit0 &&
git-clone ./. clone1 &&
git clone ./. clone1 &&
GIT_DIR=clone1/.git git update-index --add a &&
git-clone ./. clone2 &&
git clone ./. clone2 &&
GIT_DIR=clone2/.git git update-index --add a
'


4
t/t5403-post-checkout-hook.sh

@ -14,8 +14,8 @@ test_expect_success setup ' @@ -14,8 +14,8 @@ test_expect_success setup '
tree0=$(git write-tree) &&
commit0=$(echo setup | git commit-tree $tree0) &&
git update-ref refs/heads/master $commit0 &&
git-clone ./. clone1 &&
git-clone ./. clone2 &&
git clone ./. clone1 &&
git clone ./. clone2 &&
GIT_DIR=clone2/.git git branch -a new2 &&
echo Data for commit1. >clone2/b &&
GIT_DIR=clone2/.git git add clone2/b &&

4
t/t5500-fetch-pack.sh

@ -58,7 +58,7 @@ pull_to_client () { @@ -58,7 +58,7 @@ pull_to_client () {

cd client
test_expect_success "$number pull" \
"git-fetch-pack -k -v .. $heads"
"git fetch-pack -k -v .. $heads"
case "$heads" in *A*) echo $ATIP > .git/refs/heads/A;; esac
case "$heads" in *B*) echo $BTIP > .git/refs/heads/B;; esac
git symbolic-ref HEAD refs/heads/`echo $heads | sed -e 's/^\(.\).*$/\1/'`
@ -129,7 +129,7 @@ pull_to_client 2nd "B" $((64*3)) @@ -129,7 +129,7 @@ pull_to_client 2nd "B" $((64*3))

pull_to_client 3rd "A" $((1*3)) # old fails

test_expect_success "clone shallow" 'git-clone --depth 2 "file://$(pwd)/." shallow'
test_expect_success "clone shallow" 'git clone --depth 2 "file://$(pwd)/." shallow'

(cd shallow; git count-objects -v) > count.shallow


2
t/t5510-fetch.sh

@ -111,7 +111,7 @@ test_expect_success 'fetch must not resolve short tag name' ' @@ -111,7 +111,7 @@ test_expect_success 'fetch must not resolve short tag name' '
test_expect_success 'fetch must not resolve short remote name' '

cd "$D" &&
git-update-ref refs/remotes/six/HEAD HEAD
git update-ref refs/remotes/six/HEAD HEAD

mkdir six &&
cd six &&

4
t/t5530-upload-pack-error.sh

@ -34,7 +34,7 @@ test_expect_success 'upload-pack fails due to error in pack-objects' ' @@ -34,7 +34,7 @@ test_expect_success 'upload-pack fails due to error in pack-objects' '

! echo "0032want $(git rev-parse HEAD)
00000009done
0000" | git-upload-pack . > /dev/null 2> output.err &&
0000" | git upload-pack . > /dev/null 2> output.err &&
grep "pack-objects died" output.err
'

@ -52,7 +52,7 @@ test_expect_success 'upload-pack fails due to error in rev-list' ' @@ -52,7 +52,7 @@ test_expect_success 'upload-pack fails due to error in rev-list' '

! echo "0032want $(git rev-parse HEAD)
00000009done
0000" | git-upload-pack . > /dev/null 2> output.err &&
0000" | git upload-pack . > /dev/null 2> output.err &&
grep "waitpid (async) failed" output.err
'


12
t/t5600-clone-fail-cleanup.sh

@ -3,9 +3,9 @@ @@ -3,9 +3,9 @@
# Copyright (C) 2006 Carl D. Worth <cworth@cworth.org>
#

test_description='test git-clone to cleanup after failure
test_description='test git clone to cleanup after failure

This test covers the fact that if git-clone fails, it should remove
This test covers the fact that if git clone fails, it should remove
the directory it created, to avoid the user having to manually
remove the directory before attempting a clone again.'

@ -13,7 +13,7 @@ remove the directory before attempting a clone again.' @@ -13,7 +13,7 @@ remove the directory before attempting a clone again.'

test_expect_success \
'clone of non-existent source should fail' \
'test_must_fail git-clone foo bar'
'test_must_fail git clone foo bar'

test_expect_success \
'failed clone should not leave a directory' \
@ -25,15 +25,15 @@ test_create_repo foo @@ -25,15 +25,15 @@ test_create_repo foo
# clone doesn't like it if there is no HEAD. Is that a bug?
(cd foo && touch file && git add file && git commit -m 'add file' >/dev/null 2>&1)

# source repository given to git-clone should be relative to the
# source repository given to git clone should be relative to the
# current path not to the target dir
test_expect_success \
'clone of non-existent (relative to $PWD) source should fail' \
'test_must_fail git-clone ../foo baz'
'test_must_fail git clone ../foo baz'

test_expect_success \
'clone should work now that source exists' \
'git-clone foo bar'
'git clone foo bar'

test_expect_success \
'successful clone must leave the directory' \

4
t/t5602-clone-remote-exec.sh

@ -11,13 +11,13 @@ test_expect_success setup ' @@ -11,13 +11,13 @@ test_expect_success setup '
chmod +x not_ssh
'

test_expect_success 'clone calls git-upload-pack unqualified with no -u option' '
test_expect_success 'clone calls git upload-pack unqualified with no -u option' '
GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk
echo "localhost git-upload-pack '\''/path/to/repo'\''" >expected
test_cmp expected not_ssh_output
'

test_expect_success 'clone calls specified git-upload-pack with -u option' '
test_expect_success 'clone calls specified git upload-pack with -u option' '
GIT_SSH=./not_ssh git clone -u /something/bin/git-upload-pack localhost:/path/to/repo junk
echo "localhost /something/bin/git-upload-pack '\''/path/to/repo'\''" >expected
test_cmp expected not_ssh_output

6
t/t6006-rev-list-format.sh

@ -6,8 +6,8 @@ test_description='git rev-list --pretty=format test' @@ -6,8 +6,8 @@ test_description='git rev-list --pretty=format test'

test_tick
test_expect_success 'setup' '
touch foo && git add foo && git-commit -m "added foo" &&
echo changed >foo && git-commit -a -m "changed foo"
touch foo && git add foo && git commit -m "added foo" &&
echo changed >foo && git commit -a -m "changed foo"
'

# usage: test_format name format_string <expected_output
@ -110,7 +110,7 @@ include an iso8859 character: ¡bueno! @@ -110,7 +110,7 @@ include an iso8859 character: ¡bueno!
EOF
test_expect_success 'setup complex body' '
git config i18n.commitencoding iso8859-1 &&
echo change2 >foo && git-commit -a -F commit-msg
echo change2 >foo && git commit -a -F commit-msg
'

test_format complex-encoding %e <<'EOF'

32
t/t6025-merge-symlinks.sh

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@

test_description='merging symlinks on filesystem w/o symlink support.

This tests that git-merge-recursive writes merge results as plain files
This tests that git merge-recursive writes merge results as plain files
if core.symlinks is false.'

. ./test-lib.sh
@ -15,25 +15,25 @@ test_expect_success \ @@ -15,25 +15,25 @@ test_expect_success \
git config core.symlinks false &&
> file &&
git add file &&
git-commit -m initial &&
git commit -m initial &&
git branch b-symlink &&
git branch b-file &&
l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
l=$(echo -n file | git hash-object -t blob -w --stdin) &&
echo "120000 $l symlink" | git update-index --index-info &&
git-commit -m master &&
git-checkout b-symlink &&
l=$(echo -n file-different | git-hash-object -t blob -w --stdin) &&
git commit -m master &&
git checkout b-symlink &&
l=$(echo -n file-different | git hash-object -t blob -w --stdin) &&
echo "120000 $l symlink" | git update-index --index-info &&
git-commit -m b-symlink &&
git-checkout b-file &&
git commit -m b-symlink &&
git checkout b-file &&
echo plain-file > symlink &&
git add symlink &&
git-commit -m b-file'
git commit -m b-file'

test_expect_success \
'merge master into b-symlink, which has a different symbolic link' '
git-checkout b-symlink &&
test_must_fail git-merge master'
git checkout b-symlink &&
test_must_fail git merge master'

test_expect_success \
'the merge result must be a file' '
@ -41,8 +41,8 @@ test -f symlink' @@ -41,8 +41,8 @@ test -f symlink'

test_expect_success \
'merge master into b-file, which has a file instead of a symbolic link' '
git-reset --hard && git-checkout b-file &&
test_must_fail git-merge master'
git reset --hard && git checkout b-file &&
test_must_fail git merge master'

test_expect_success \
'the merge result must be a file' '
@ -50,9 +50,9 @@ test -f symlink' @@ -50,9 +50,9 @@ test -f symlink'

test_expect_success \
'merge b-file, which has a file instead of a symbolic link, into master' '
git-reset --hard &&
git-checkout master &&
test_must_fail git-merge b-file'
git reset --hard &&
git checkout master &&
test_must_fail git merge b-file'

test_expect_success \
'the merge result must be a file' '

12
t/t6026-merge-attr.sh

@ -106,9 +106,9 @@ test_expect_success 'custom merge backend' ' @@ -106,9 +106,9 @@ test_expect_success 'custom merge backend' '

cmp binary union &&
sed -e 1,3d text >check-1 &&
o=$(git-unpack-file master^:text) &&
a=$(git-unpack-file side^:text) &&
b=$(git-unpack-file master:text) &&
o=$(git unpack-file master^:text) &&
a=$(git unpack-file side^:text) &&
b=$(git unpack-file master:text) &&
sh -c "./custom-merge $o $a $b 0" &&
sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 &&
@ -133,9 +133,9 @@ test_expect_success 'custom merge backend' ' @@ -133,9 +133,9 @@ test_expect_success 'custom merge backend' '

cmp binary union &&
sed -e 1,3d text >check-1 &&
o=$(git-unpack-file master^:text) &&
a=$(git-unpack-file anchor:text) &&
b=$(git-unpack-file master:text) &&
o=$(git unpack-file master^:text) &&
a=$(git unpack-file anchor:text) &&
b=$(git unpack-file master:text) &&
sh -c "./custom-merge $o $a $b 0" &&
sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 &&

4
t/t6030-bisect-porcelain.sh

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
#
# Copyright (c) 2007 Christian Couder
#
test_description='Tests git-bisect functionality'
test_description='Tests git bisect functionality'

exec </dev/null

@ -23,7 +23,7 @@ add_line_into_file() @@ -23,7 +23,7 @@ add_line_into_file()
fi

test_tick
git-commit --quiet -m "$MSG" $_file
git commit --quiet -m "$MSG" $_file
}

HASH1=

30
t/t6120-describe.sh

@ -31,57 +31,57 @@ check_describe () { @@ -31,57 +31,57 @@ check_describe () {
test_expect_success setup '

test_tick &&
echo one >file && git add file && git-commit -m initial &&
echo one >file && git add file && git commit -m initial &&
one=$(git rev-parse HEAD) &&

test_tick &&
echo two >file && git add file && git-commit -m second &&
echo two >file && git add file && git commit -m second &&
two=$(git rev-parse HEAD) &&

test_tick &&
echo three >file && git add file && git-commit -m third &&
echo three >file && git add file && git commit -m third &&

test_tick &&
echo A >file && git add file && git-commit -m A &&
echo A >file && git add file && git commit -m A &&
test_tick &&
git-tag -a -m A A &&
git tag -a -m A A &&

test_tick &&
echo c >file && git add file && git-commit -m c &&
echo c >file && git add file && git commit -m c &&
test_tick &&
git-tag c &&
git tag c &&

git reset --hard $two &&
test_tick &&
echo B >side && git add side && git-commit -m B &&
echo B >side && git add side && git commit -m B &&
test_tick &&
git-tag -a -m B B &&
git tag -a -m B B &&

test_tick &&
git-merge -m Merged c &&
git merge -m Merged c &&
merged=$(git rev-parse HEAD) &&

git reset --hard $two &&
test_tick &&
echo D >another && git add another && git-commit -m D &&
echo D >another && git add another && git commit -m D &&
test_tick &&
git-tag -a -m D D &&
git tag -a -m D D &&

test_tick &&
echo DD >another && git commit -a -m another &&

test_tick &&
git-tag e &&
git tag e &&

test_tick &&
echo DDD >another && git commit -a -m "yet another" &&

test_tick &&
git-merge -m Merged $merged &&
git merge -m Merged $merged &&

test_tick &&
echo X >file && echo X >side && git add file side &&
git-commit -m x
git commit -m x

'


28
t/t6300-for-each-ref.sh

@ -97,27 +97,27 @@ test_atom tag contents 'Tagging at 1151939927 @@ -97,27 +97,27 @@ test_atom tag contents 'Tagging at 1151939927
'

test_expect_success 'Check invalid atoms names are errors' '
test_must_fail git-for-each-ref --format="%(INVALID)" refs/heads
test_must_fail git for-each-ref --format="%(INVALID)" refs/heads
'

test_expect_success 'Check format specifiers are ignored in naming date atoms' '
git-for-each-ref --format="%(authordate)" refs/heads &&
git-for-each-ref --format="%(authordate:default) %(authordate)" refs/heads &&
git-for-each-ref --format="%(authordate) %(authordate:default)" refs/heads &&
git-for-each-ref --format="%(authordate:default) %(authordate:default)" refs/heads
git for-each-ref --format="%(authordate)" refs/heads &&
git for-each-ref --format="%(authordate:default) %(authordate)" refs/heads &&
git for-each-ref --format="%(authordate) %(authordate:default)" refs/heads &&
git for-each-ref --format="%(authordate:default) %(authordate:default)" refs/heads
'

test_expect_success 'Check valid format specifiers for date fields' '
git-for-each-ref --format="%(authordate:default)" refs/heads &&
git-for-each-ref --format="%(authordate:relative)" refs/heads &&
git-for-each-ref --format="%(authordate:short)" refs/heads &&
git-for-each-ref --format="%(authordate:local)" refs/heads &&
git-for-each-ref --format="%(authordate:iso8601)" refs/heads &&
git-for-each-ref --format="%(authordate:rfc2822)" refs/heads
git for-each-ref --format="%(authordate:default)" refs/heads &&
git for-each-ref --format="%(authordate:relative)" refs/heads &&
git for-each-ref --format="%(authordate:short)" refs/heads &&
git for-each-ref --format="%(authordate:local)" refs/heads &&
git for-each-ref --format="%(authordate:iso8601)" refs/heads &&
git for-each-ref --format="%(authordate:rfc2822)" refs/heads
'

test_expect_success 'Check invalid format specifiers are errors' '
test_must_fail git-for-each-ref --format="%(authordate:INVALID)" refs/heads
test_must_fail git for-each-ref --format="%(authordate:INVALID)" refs/heads
'

cat >expected <<\EOF
@ -207,7 +207,7 @@ refs/tags/testtag @@ -207,7 +207,7 @@ refs/tags/testtag
EOF

test_expect_success 'Verify ascending sort' '
git-for-each-ref --format="%(refname)" --sort=refname >actual &&
git for-each-ref --format="%(refname)" --sort=refname >actual &&
test_cmp expected actual
'

@ -218,7 +218,7 @@ refs/heads/master @@ -218,7 +218,7 @@ refs/heads/master
EOF

test_expect_success 'Verify descending sort' '
git-for-each-ref --format="%(refname)" --sort=-refname >actual &&
git for-each-ref --format="%(refname)" --sort=-refname >actual &&
test_cmp expected actual
'


Loading…
Cancel
Save