]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t5701-clone-local.sh
t/t7811-grep-open.sh: ensure fake "less" is made executable
[git.git] / t / t5701-clone-local.sh
index fe0fda282ca4f085f506c743848966fa6bb93591..8b4c356cd21846025d84a434077bfdc8ee2bab57 100755 (executable)
@@ -116,4 +116,32 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
        test ! -e .git/refs/heads/master
 '
 
+test_expect_success 'clone empty repository' '
+       cd "$D" &&
+       mkdir empty &&
+       (cd empty &&
+        git init &&
+        git config receive.denyCurrentBranch warn) &&
+       git clone empty empty-clone &&
+       test_tick &&
+       (cd empty-clone
+        echo "content" >> foo &&
+        git add foo &&
+        git commit -m "Initial commit" &&
+        git push origin master &&
+        expected=$(git rev-parse master) &&
+        actual=$(git --git-dir=../empty/.git rev-parse master) &&
+        test $actual = $expected)
+'
+
+test_expect_success 'clone empty repository, and then push should not segfault.' '
+       cd "$D" &&
+       rm -fr empty/ empty-clone/ &&
+       mkdir empty &&
+       (cd empty && git init) &&
+       git clone empty empty-clone &&
+       (cd empty-clone &&
+       test_must_fail git push)
+'
+
 test_done