X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5515-fetch-merge-logic.sh;h=1f4608d8ba4748a2bd5c7a3d5a75a04364e8f646;hb=3fee1fe87144360a1913eab86af9ad136c810076;hp=65c37744aaa074d173afb862ca43fa668bc19452;hpb=2a5fe2545882721d6841bad11dae0f15b454bf0d;p=git.git diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh index 65c37744a..1f4608d8b 100755 --- a/t/t5515-fetch-merge-logic.sh +++ b/t/t5515-fetch-merge-logic.sh @@ -131,9 +131,9 @@ do test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'` cnt=`expr $test_count + 1` pfx=`printf "%04d" $cnt` - expect_f="../../t5515/fetch.$test" + 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,16 +142,19 @@ 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" && git show-ref >"$actual_r" && if test -f "$expect_f" then - git diff -u "$expect_f" "$actual_f" && + test_cmp "$expect_f" "$actual_f" && rm -f "$actual_f" else # this is to help developing new tests. @@ -160,7 +163,7 @@ do fi && if test -f "$expect_r" then - git diff -u "$expect_r" "$actual_r" && + test_cmp "$expect_r" "$actual_r" && rm -f "$actual_r" else # this is to help developing new tests.