Merge branch 'js/clone-dissociate' into maint
[gitweb.git] / t / t3210-pack-refs.sh
index aa9eb3a3e5ef0637615c6d958a29dbd9bbbf0895..7b5b6d452e3762c9d0e311602bf39317200c21a7 100755 (executable)
@@ -169,7 +169,7 @@ test_expect_success 'create packed foo/bar/baz branch' '
        git branch foo/bar/baz &&
        git pack-refs --all --prune &&
        test_path_is_missing .git/refs/heads/foo/bar/baz &&
-       test_path_is_missing .git/logs/refs/heads/foo/bar/baz
+       test_must_fail git reflog exists refs/heads/foo/bar/baz
 '
 
 test_expect_success 'notice d/f conflict with existing directory' '
@@ -187,4 +187,21 @@ test_expect_success 'notice d/f conflict with existing ref' '
        test_must_fail git branch foo/bar/baz/lots/of/extra/components
 '
 
+test_expect_success 'timeout if packed-refs.lock exists' '
+       LOCK=.git/packed-refs.lock &&
+       >"$LOCK" &&
+       test_when_finished "rm -f $LOCK" &&
+       test_must_fail git pack-refs --all --prune
+'
+
+test_expect_success 'retry acquiring packed-refs.lock' '
+       LOCK=.git/packed-refs.lock &&
+       >"$LOCK" &&
+       test_when_finished "wait; rm -f $LOCK" &&
+       {
+               ( sleep 1 ; rm -f $LOCK ) &
+       } &&
+       git -c core.packedrefstimeout=3000 pack-refs --all --prune
+'
+
 test_done