summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t1400-update-ref.sh7
-rwxr-xr-xt/t3200-branch.sh9
-rwxr-xr-xt/t3210-pack-refs.sh99
-rwxr-xr-xt/t3401-rebase-partial.sh5
-rwxr-xr-xt/t3402-rebase-merge.sh6
-rwxr-xr-xt/t3403-rebase-skip.sh6
-rw-r--r--t/t4013/diff.diff-tree_--pretty_--root_--summary_initial2
-rwxr-xr-xt/t5000-tar-tree.sh35
-rwxr-xr-xt/t6021-merge-criss-cross.sh6
-rwxr-xr-xt/t6022-merge-rename.sh6
10 files changed, 141 insertions, 40 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index b3b920edb1..6a917f2ff4 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -30,11 +30,8 @@ rm -f .git/$m
test_expect_success \
"fail to create $n" \
"touch .git/$n_dir
- git-update-ref $n $A >out 2>err
- test "'$? = 1 &&
- test "" = "$(cat out)" &&
- grep "error: unable to resolve reference" err &&
- grep '"$n err"
+ git-update-ref $n $A >out 2>err"'
+ test $? != 0'
rm -f .git/$n_dir out err
test_expect_success \
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 6907cbcd29..acb54b6a07 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -17,13 +17,10 @@ test_expect_success \
git-commit -m "Initial commit." &&
HEAD=$(git-rev-parse --verify HEAD)'
-test_expect_success \
- 'git branch --help should return success now.' \
- 'git-branch --help'
-
test_expect_failure \
'git branch --help should not have created a bogus branch' \
- 'test -f .git/refs/heads/--help'
+ 'git-branch --help </dev/null >/dev/null 2>/dev/null || :
+ test -f .git/refs/heads/--help'
test_expect_success \
'git branch abc should create a branch' \
@@ -34,7 +31,7 @@ test_expect_success \
'git-branch a/b/c && test -f .git/refs/heads/a/b/c'
cat >expect <<EOF
-0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from HEAD
+0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master
EOF
test_expect_success \
'git branch -l d/e/f should create a branch and a log' \
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
new file mode 100755
index 0000000000..b1e9f2eed2
--- /dev/null
+++ b/t/t3210-pack-refs.sh
@@ -0,0 +1,99 @@
+#!/bin/sh
+#
+# Copyright (c) 2005 Amos Waterland
+# Copyright (c) 2006 Christian Couder
+#
+
+test_description='git pack-refs should not change the branch semantic
+
+This test runs git pack-refs and git show-ref and checks that the branch
+semantic is still the same.
+'
+. ./test-lib.sh
+
+echo '[core] logallrefupdates = true' >>.git/config
+
+test_expect_success \
+ 'prepare a trivial repository' \
+ 'echo Hello > A &&
+ git-update-index --add A &&
+ git-commit -m "Initial commit." &&
+ HEAD=$(git-rev-parse --verify HEAD)'
+
+SHA1=
+
+test_expect_success \
+ 'see if git show-ref works as expected' \
+ 'git-branch a &&
+ SHA1=`cat .git/refs/heads/a` &&
+ echo "$SHA1 refs/heads/a" >expect &&
+ git-show-ref a >result &&
+ diff expect result'
+
+test_expect_success \
+ 'see if a branch still exists when packed' \
+ 'git-branch b &&
+ git-pack-refs --all &&
+ rm .git/refs/heads/b &&
+ echo "$SHA1 refs/heads/b" >expect &&
+ git-show-ref b >result &&
+ diff expect result'
+
+test_expect_failure \
+ 'git branch c/d should barf if branch c exists' \
+ 'git-branch c &&
+ git-pack-refs --all &&
+ rm .git/refs/heads/c &&
+ git-branch c/d'
+
+test_expect_success \
+ 'see if a branch still exists after git pack-refs --prune' \
+ 'git-branch e &&
+ git-pack-refs --all --prune &&
+ echo "$SHA1 refs/heads/e" >expect &&
+ git-show-ref e >result &&
+ diff expect result'
+
+test_expect_failure \
+ 'see if git pack-refs --prune remove ref files' \
+ 'git-branch f &&
+ git-pack-refs --all --prune &&
+ ls .git/refs/heads/f'
+
+test_expect_success \
+ 'git branch g should work when git branch g/h has been deleted' \
+ 'git-branch g/h &&
+ git-pack-refs --all --prune &&
+ git-branch -d g/h &&
+ git-branch g &&
+ git-pack-refs --all &&
+ git-branch -d g'
+
+test_expect_failure \
+ 'git branch i/j/k should barf if branch i exists' \
+ 'git-branch i &&
+ git-pack-refs --all --prune &&
+ git-branch i/j/k'
+
+test_expect_success \
+ 'test git branch k after branch k/l/m and k/lm have been deleted' \
+ 'git-branch k/l &&
+ git-branch k/lm &&
+ git-branch -d k/l &&
+ git-branch k/l/m &&
+ git-branch -d k/l/m &&
+ git-branch -d k/lm &&
+ git-branch k'
+
+test_expect_success \
+ 'test git branch n after some branch deletion and pruning' \
+ 'git-branch n/o &&
+ git-branch n/op &&
+ git-branch -d n/o &&
+ git-branch n/o/p &&
+ git-branch -d n/op &&
+ git-pack-refs --all --prune &&
+ git-branch -d n/o/p &&
+ git-branch n'
+
+test_done
diff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh
index 360a67060e..8b19d3ccea 100755
--- a/t/t3401-rebase-partial.sh
+++ b/t/t3401-rebase-partial.sh
@@ -52,13 +52,10 @@ test_expect_success \
'rebase topic branch against new master and check git-am did not get halted' \
'git-rebase master && test ! -d .dotest'
-if test -z "$no_python"
-then
- test_expect_success \
+test_expect_success \
'rebase --merge topic branch that was partially merged upstream' \
'git-checkout -f my-topic-branch-merge &&
git-rebase --merge master-merge &&
test ! -d .git/.dotest-merge'
-fi
test_done
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index d34c6cf6f3..0779aaa9ab 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -7,12 +7,6 @@ test_description='git rebase --merge test'
. ./test-lib.sh
-if test "$no_python"; then
- echo "Skipping: no python => no recursive merge"
- test_done
- exit 0
-fi
-
T="A quick brown fox
jumps over the lazy dog."
for i in 1 2 3 4 5 6 7 8 9 10
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index bb25315361..977c498f00 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -10,12 +10,6 @@ test_description='git rebase --merge --skip tests'
# we assume the default git-am -3 --skip strategy is tested independently
# and always works :)
-if test "$no_python"; then
- echo "Skipping: no python => no recursive merge"
- test_done
- exit 0
-fi
-
test_expect_success setup '
echo hello > hello &&
git add hello &&
diff --git a/t/t4013/diff.diff-tree_--pretty_--root_--summary_initial b/t/t4013/diff.diff-tree_--pretty_--root_--summary_initial
index ea48205537..58e5f74aea 100644
--- a/t/t4013/diff.diff-tree_--pretty_--root_--summary_initial
+++ b/t/t4013/diff.diff-tree_--pretty_--root_--summary_initial
@@ -5,7 +5,7 @@ Date: Mon Jun 26 00:00:00 2006 +0000
Initial
- create mode 040000 dir
+ create mode 100644 dir/sub
create mode 100644 file0
create mode 100644 file2
$
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 278eb66701..cf08e9279c 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -26,6 +26,7 @@ commit id embedding:
. ./test-lib.sh
TAR=${TAR:-tar}
+UNZIP=${UNZIP:-unzip}
test_expect_success \
'populate workdir' \
@@ -95,4 +96,38 @@ test_expect_success \
'validate file contents with prefix' \
'diff -r a c/prefix/a'
+test_expect_success \
+ 'git-archive --format=zip' \
+ 'git-archive --format=zip HEAD >d.zip'
+
+test_expect_success \
+ 'extract ZIP archive' \
+ '(mkdir d && cd d && $UNZIP ../d.zip)'
+
+test_expect_success \
+ 'validate filenames' \
+ '(cd d/a && find .) | sort >d.lst &&
+ diff a.lst d.lst'
+
+test_expect_success \
+ 'validate file contents' \
+ 'diff -r a d/a'
+
+test_expect_success \
+ 'git-archive --format=zip with prefix' \
+ 'git-archive --format=zip --prefix=prefix/ HEAD >e.zip'
+
+test_expect_success \
+ 'extract ZIP archive with prefix' \
+ '(mkdir e && cd e && $UNZIP ../e.zip)'
+
+test_expect_success \
+ 'validate filenames with prefix' \
+ '(cd e/prefix/a && find .) | sort >e.lst &&
+ diff a.lst e.lst'
+
+test_expect_success \
+ 'validate file contents with prefix' \
+ 'diff -r a e/prefix/a'
+
test_done
diff --git a/t/t6021-merge-criss-cross.sh b/t/t6021-merge-criss-cross.sh
index 8f7366da8d..499cafb882 100755
--- a/t/t6021-merge-criss-cross.sh
+++ b/t/t6021-merge-criss-cross.sh
@@ -10,12 +10,6 @@
test_description='Test criss-cross merge'
. ./test-lib.sh
-if test "$no_python"; then
- echo "Skipping: no python => no recursive merge"
- test_done
- exit 0
-fi
-
test_expect_success 'prepare repository' \
'echo "1
2
diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh
index 5ac25647ab..497ef36ad8 100755
--- a/t/t6022-merge-rename.sh
+++ b/t/t6022-merge-rename.sh
@@ -3,12 +3,6 @@
test_description='Merge-recursive merging renames'
. ./test-lib.sh
-if test "$no_python"; then
- echo "Skipping: no python => no recursive merge"
- test_done
- exit 0
-fi
-
test_expect_success setup \
'
cat >A <<\EOF &&