Merge branch 'js/t6500-use-windows-pid-on-mingw'
[gitweb.git] / t / t6500-gc.sh
index 53258d45a1255305e05307451cc5272c95f85d6a..515c6735e9cb076c9f4b5a252c48216765b5076a 100755 (executable)
@@ -120,6 +120,25 @@ test_expect_success 'gc --quiet' '
        test_must_be_empty stderr
 '
 
+test_expect_success 'gc.reflogExpire{Unreachable,}=never skips "expire" via "gc"' '
+       test_config gc.reflogExpire never &&
+       test_config gc.reflogExpireUnreachable never &&
+
+       GIT_TRACE=$(pwd)/trace.out git gc &&
+
+       # Check that git-pack-refs is run as a sanity check (done via
+       # gc_before_repack()) but that git-expire is not.
+       grep -E "^trace: (built-in|exec|run_command): git pack-refs --" trace.out &&
+       ! grep -E "^trace: (built-in|exec|run_command): git reflog expire --" trace.out
+'
+
+test_expect_success 'one of gc.reflogExpire{Unreachable,}=never does not skip "expire" via "gc"' '
+       >trace.out &&
+       test_config gc.reflogExpire never &&
+       GIT_TRACE=$(pwd)/trace.out git gc &&
+       grep -E "^trace: (built-in|exec|run_command): git reflog expire --" trace.out
+'
+
 run_and_wait_for_auto_gc () {
        # We read stdout from gc for the side effect of waiting until the
        # background gc process exits, closing its fd 9.  Furthermore, the