Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-26 11:17:07 +0300
committerJunio C Hamano <gitster@pobox.com>2008-03-26 11:29:54 +0300
commita466637c57b969626344e5998b29fb123569fdc2 (patch)
tree68fd441836679accf836a66c8f255d9007e4b902 /t/t5515-fetch-merge-logic.sh
parent472fa4cd33c690dd9b338c02af3ed135666aea43 (diff)
git-fetch test: test tracking fetch results, not just FETCH_HEAD
We really should have done this long time ago. Existing t5515 test was written for the specific purpose of catching regression to the contents of generated FETCH_HEAD file, but it also is a good place to make sure various fetch configurations do fetch what they intend to fetch (and nothing else). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5515-fetch-merge-logic.sh')
-rwxr-xr-xt/t5515-fetch-merge-logic.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 31c1081617..65c37744aa 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -131,8 +131,10 @@ do
test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
cnt=`expr $test_count + 1`
pfx=`printf "%04d" $cnt`
- expect="../../t5515/fetch.$test"
- actual="$pfx-fetch.$test"
+ expect_f="../../t5515/fetch.$test"
+ actual_f="$pfx-fetch.$test"
+ expect_r="../../t5515/refs.$test"
+ actual_r="$pfx-refs.$test"
test_expect_success "$cmd" '
{
@@ -145,14 +147,24 @@ do
rm -f .git/refs/tags/*
git fetch "$@" >/dev/null
cat .git/FETCH_HEAD
- } >"$actual" &&
- if test -f "$expect"
+ } >"$actual_f" &&
+ git show-ref >"$actual_r" &&
+ if test -f "$expect_f"
then
- git diff -u "$expect" "$actual" &&
- rm -f "$actual"
+ git diff -u "$expect_f" "$actual_f" &&
+ rm -f "$actual_f"
else
# this is to help developing new tests.
- cp "$actual" "$expect"
+ cp "$actual_f" "$expect_f"
+ false
+ fi &&
+ if test -f "$expect_r"
+ then
+ git diff -u "$expect_r" "$actual_r" &&
+ rm -f "$actual_r"
+ else
+ # this is to help developing new tests.
+ cp "$actual_r" "$expect_r"
false
fi
'