gitweb: escape html in rss title
[gitweb.git] / t / t5515-fetch-merge-logic.sh
index 3def75eeb29f0eeaa096ab4b9f4511a01a3ce3d8..dbb927dec8ea9f40e8e106f416c276f1b6a07868 100755 (executable)
@@ -129,11 +129,10 @@ do
        '' | '#'*) continue ;;
        esac
        test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
-       cnt=`expr $test_count + 1`
-       pfx=`printf "%04d" $cnt`
-       expect_f="../../t5515/fetch.$test"
+       pfx=`printf "%04d" $test_count`
+       expect_f="$TEST_DIRECTORY/t5515/fetch.$test"
        actual_f="$pfx-fetch.$test"
-       expect_r="../../t5515/refs.$test"
+       expect_r="$TEST_DIRECTORY/t5515/refs.$test"
        actual_r="$pfx-refs.$test"
 
        test_expect_success "$cmd" '
@@ -142,9 +141,12 @@ do
                        set x $cmd; shift
                        git symbolic-ref HEAD refs/heads/$1 ; shift
                        rm -f .git/FETCH_HEAD
-                       rm -f .git/refs/heads/*
-                       rm -f .git/refs/remotes/rem/*
-                       rm -f .git/refs/tags/*
+                       git for-each-ref \
+                               refs/heads refs/remotes/rem refs/tags |
+                       while read val type refname
+                       do
+                               git update-ref -d "$refname" "$val"
+                       done
                        git fetch "$@" >/dev/null
                        cat .git/FETCH_HEAD
                } >"$actual_f" &&