aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t3200-branch.sh6
-rwxr-xr-xt/t5300-pack-object.sh73
-rwxr-xr-xt/t5520-pull.sh24
3 files changed, 96 insertions, 7 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 75c000a96..9558bdb63 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -145,9 +145,15 @@ test_expect_success 'test overriding tracking setup via --no-track' \
git-config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
(git-show-ref -q refs/remotes/local/master || git-fetch local) &&
git-branch --no-track my2 local/master &&
+ git-config branch.autosetupmerge false &&
! test $(git-config branch.my2.remote) = local &&
! test $(git-config branch.my2.merge) = refs/heads/master'
+test_expect_success 'test local tracking setup' \
+ 'git branch --track my6 s &&
+ test $(git-config branch.my6.remote) = . &&
+ test $(git-config branch.my6.merge) = refs/heads/s'
+
# Keep this test last, as it changes the current branch
cat >expect <<EOF
0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index f51154745..eacb1e92c 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -64,7 +64,7 @@ test_expect_success \
cd "$TRASH"
test_expect_success \
- 'pack with delta' \
+ 'pack with REF_DELTA' \
'pwd &&
packname_2=$(git-pack-objects test-2 <obj-list)'
@@ -72,7 +72,7 @@ rm -fr .git2
mkdir .git2
test_expect_success \
- 'unpack with delta' \
+ 'unpack with REF_DELTA' \
'GIT_OBJECT_DIRECTORY=.git2/objects &&
export GIT_OBJECT_DIRECTORY &&
git-init &&
@@ -82,7 +82,7 @@ test_expect_success \
unset GIT_OBJECT_DIRECTORY
cd "$TRASH/.git2"
test_expect_success \
- 'check unpack with delta' \
+ 'check unpack with REF_DELTA' \
'(cd ../.git && find objects -type f -print) |
while read path
do
@@ -93,6 +93,42 @@ test_expect_success \
done'
cd "$TRASH"
+test_expect_success \
+ 'pack with OFS_DELTA' \
+ 'pwd &&
+ packname_3=$(git-pack-objects --delta-base-offset test-3 <obj-list)'
+
+rm -fr .git2
+mkdir .git2
+
+test_expect_success \
+ 'unpack with OFS_DELTA' \
+ 'GIT_OBJECT_DIRECTORY=.git2/objects &&
+ export GIT_OBJECT_DIRECTORY &&
+ git-init &&
+ git-unpack-objects -n <test-3-${packname_3}.pack &&
+ git-unpack-objects <test-3-${packname_3}.pack'
+
+unset GIT_OBJECT_DIRECTORY
+cd "$TRASH/.git2"
+test_expect_success \
+ 'check unpack with OFS_DELTA' \
+ '(cd ../.git && find objects -type f -print) |
+ while read path
+ do
+ cmp $path ../.git/$path || {
+ echo $path differs.
+ return 1
+ }
+ done'
+cd "$TRASH"
+
+test_expect_success \
+ 'compare delta flavors' \
+ 'size_2=`stat -c "%s" test-2-${packname_2}.pack` &&
+ size_3=`stat -c "%s" test-3-${packname_3}.pack` &&
+ test $size_2 -gt $size_3'
+
rm -fr .git2
mkdir .git2
@@ -111,12 +147,11 @@ test_expect_success \
} >current &&
diff expect current'
-
test_expect_success \
- 'use packed deltified objects' \
+ 'use packed deltified (REF_DELTA) objects' \
'GIT_OBJECT_DIRECTORY=.git2/objects &&
export GIT_OBJECT_DIRECTORY &&
- rm -f .git2/objects/pack/test-?.idx &&
+ rm .git2/objects/pack/test-* &&
cp test-2-${packname_2}.pack test-2-${packname_2}.idx .git2/objects/pack && {
git-diff-tree --root -p $commit &&
while read object
@@ -127,11 +162,28 @@ test_expect_success \
} >current &&
diff expect current'
+test_expect_success \
+ 'use packed deltified (OFS_DELTA) objects' \
+ 'GIT_OBJECT_DIRECTORY=.git2/objects &&
+ export GIT_OBJECT_DIRECTORY &&
+ rm .git2/objects/pack/test-* &&
+ cp test-3-${packname_3}.pack test-3-${packname_3}.idx .git2/objects/pack && {
+ git-diff-tree --root -p $commit &&
+ while read object
+ do
+ t=`git-cat-file -t $object` &&
+ git-cat-file $t $object || return 1
+ done <obj-list
+ } >current &&
+ diff expect current'
+
unset GIT_OBJECT_DIRECTORY
test_expect_success \
'verify pack' \
- 'git-verify-pack test-1-${packname_1}.idx test-2-${packname_2}.idx'
+ 'git-verify-pack test-1-${packname_1}.idx \
+ test-2-${packname_2}.idx \
+ test-3-${packname_3}.idx'
test_expect_success \
'corrupt a pack and see if verify catches' \
@@ -194,6 +246,13 @@ test_expect_success \
git-index-pack test-3.pack &&
cmp test-3.idx test-2-${packname_2}.idx &&
+ cp test-3-${packname_3}.pack test-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 &&
+ cmp test-3.idx test-3-${packname_3}.idx &&
+
:'
test_done
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 7eb37838b..243212d3d 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -29,5 +29,29 @@ test_expect_success 'checking the results' '
diff file cloned/file
'
+test_expect_success 'test . as a remote' '
+
+ git branch copy master &&
+ git config branch.copy.remote . &&
+ git config branch.copy.merge refs/heads/master &&
+ echo updated >file &&
+ git commit -a -m updated &&
+ git checkout copy &&
+ test `cat file` = file &&
+ git pull &&
+ test `cat file` = updated
+'
+
+test_expect_success 'the default remote . should not break explicit pull' '
+ git checkout -b second master^ &&
+ echo modified >file &&
+ git commit -a -m modified &&
+ git checkout copy &&
+ git reset --hard HEAD^ &&
+ test `cat file` = file &&
+ git pull . second &&
+ test `cat file` = modified
+'
+
test_done