Code

Hopefully the final update to draft release notes for 1.5.3.
[git.git] / t / t5700-clone-reference.sh
index 916ee15ba1ed840fbd0df9d91e4f06fae8fde357..4e93aaab02e7b84b4bcf6ac70515e6cf52f0dabc 100755 (executable)
@@ -26,12 +26,12 @@ git prune'
 
 cd "$base_dir"
 
-test_expect_success 'cloning with reference' \
+test_expect_success 'cloning with reference (-l -s)' \
 'git clone -l -s --reference B A C'
 
 cd "$base_dir"
 
-test_expect_success 'existance of info/alternates' \
+test_expect_success 'existence of info/alternates' \
 'test `wc -l <C/.git/objects/info/alternates` = 2'
 
 cd "$base_dir"
@@ -50,6 +50,28 @@ diff expected current'
 
 cd "$base_dir"
 
+test_expect_success 'cloning with reference (no -l -s)' \
+'git clone --reference B file://`pwd`/A D'
+
+cd "$base_dir"
+
+test_expect_success 'existence of info/alternates' \
+'test `wc -l <D/.git/objects/info/alternates` = 1'
+
+cd "$base_dir"
+
+test_expect_success 'pulling from reference' \
+'cd D && git pull ../B'
+
+cd "$base_dir"
+
+test_expect_success 'that reference gets used' \
+'cd D && echo "0 objects, 0 kilobytes" > expected &&
+git count-objects > current &&
+diff expected current'
+
+cd "$base_dir"
+
 test_expect_success 'updating origin' \
 'cd A &&
 echo third > file3 &&
@@ -75,4 +97,20 @@ diff expected current'
 
 cd "$base_dir"
 
+test_expect_success 'pulling changes from origin' \
+'cd D &&
+git pull origin'
+
+cd "$base_dir"
+
+# the 5 local objects are expected; file3 blob, commit in A to add it
+# and its tree, and 2 are our tree and the merge commit.
+test_expect_success 'check objects expected to exist locally' \
+'cd D &&
+echo "5 objects" > expected &&
+git count-objects | cut -d, -f1 > current &&
+diff expected current'
+
+cd "$base_dir"
+
 test_done