]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4207-log-decoration-colors.sh
t4207: delete replace references via git-update-ref(1)
[thirdparty/git.git] / t / t4207-log-decoration-colors.sh
index 21986a866df65c9ed9025f7ab48dc596e6df81ca..73ea9e515503baf7776aaba04a4b6d9de7e20c92 100755 (executable)
@@ -70,8 +70,14 @@ ${c_tag}tag: ${c_reset}${c_tag}A${c_reset}${c_commit})${c_reset} A
        cmp_filtered_decorations
 '
 
+remove_replace_refs () {
+       git for-each-ref 'refs/replace*/**' --format='delete %(refname)' >in &&
+       git update-ref --stdin <in &&
+       rm in
+}
+
 test_expect_success 'test coloring with replace-objects' '
-       test_when_finished rm -rf .git/refs/replace* &&
+       test_when_finished remove_replace_refs &&
        test_commit C &&
        test_commit D &&
 
@@ -99,7 +105,7 @@ EOF
 '
 
 test_expect_success 'test coloring with grafted commit' '
-       test_when_finished rm -rf .git/refs/replace* &&
+       test_when_finished remove_replace_refs &&
 
        git replace --graft HEAD HEAD~2 &&