t9104: kosherly remove remote refs
authorChristian Couder <christian.couder@gmail.com>
Fri, 1 Jun 2018 05:08:33 +0000 (07:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Jun 2018 02:22:45 +0000 (11:22 +0900)
As there are plans to implement other ref storage systems,
let's use a way to remove remote refs that does not depend
on refs being files.

This makes it clear to readers that this test does not
depend on which ref backend is used.

Suggested-by: Michael Haggerty <mhagger@alum.mit.edu>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9104-git-svn-follow-parent.sh
index 0c9c8f9f031f3e6561a3b962f77ef6041f1593c8..a9734a32bfe86cd759968684eb13bff9a3dcbab3 100755 (executable)
@@ -213,7 +213,9 @@ test_expect_success "multi-fetch continues to work" "
        "
 
 test_expect_success "multi-fetch works off a 'clean' repository" '
-       rm -rf "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" &&
+       rm -rf "$GIT_DIR/svn" &&
+       git for-each-ref --format="option no-deref%0adelete %(refname)" refs/remotes |
+       git update-ref --stdin &&
        git reflog expire --all --expire=all &&
        mkdir "$GIT_DIR/svn" &&
        git svn multi-fetch