summaryrefslogtreecommitdiff
path: root/t/t5515-fetch-merge-logic.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-07-06 15:37:42 -0700
committerJunio C Hamano <gitster@pobox.com>2011-07-06 15:37:42 -0700
commit4d9e42f8f11c57b32b976a943c8ddaf6214e64b8 (patch)
treef1aee1490288aa30fb62a981696389d9b5e3e992 /t/t5515-fetch-merge-logic.sh
parentc5bcf1f9f6d3429ab9a09e07e28362e7d189005b (diff)
parentea02eef096d4bfcbb83e76cfab0fcb42dbcad35e (diff)
downloadgit-4d9e42f8f11c57b32b976a943c8ddaf6214e64b8.tar.gz
Merge commit 'v1.6.0' into jc/checkout-reflog-fix
* commit 'v1.6.0': (2063 commits) GIT 1.6.0 git-p4: chdir now properly sets PWD environment variable in msysGit Improve error output of git-rebase t9300: replace '!' with test_must_fail Git.pm: Make File::Spec and File::Temp requirement lazy Documentation: document the pager.* configuration setting git-stash: improve synopsis in help and manual page Makefile: building git in cygwin 1.7.0 git-am: ignore --binary option bash-completion: Add non-command git help files to bash-completion Fix t3700 on filesystems which do not support question marks in names Utilise our new p4_read_pipe and p4_write_pipe wrappers Add p4 read_pipe and write_pipe wrappers bash completion: Add '--merge' long option for 'git log' bash completion: Add completion for 'git mergetool' git format-patch documentation: clarify what --cover-letter does bash completion: 'git apply' should use 'fix' not 'strip' t5304-prune: adjust file mtime based on system time rather than file mtime test-parse-options: use appropriate cast in length_callback Fix escaping of glob special characters in pathspecs ... Conflicts: builtin-checkout.c
Diffstat (limited to 't/t5515-fetch-merge-logic.sh')
-rwxr-xr-xt/t5515-fetch-merge-logic.sh35
1 files changed, 25 insertions, 10 deletions
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 31c1081617..8becbc3f38 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" '
{
@@ -140,19 +142,32 @@ 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" &&
- 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"
+ test_cmp "$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
+ test_cmp "$expect_r" "$actual_r" &&
+ rm -f "$actual_r"
+ else
+ # this is to help developing new tests.
+ cp "$actual_r" "$expect_r"
false
fi
'