From: Junio C Hamano Date: Mon, 25 Jun 2018 20:22:41 +0000 (-0700) Subject: Merge branch 'cc/tests-without-assuming-ref-files-backend' X-Git-Tag: v2.19.0-rc0~182 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/90fa1c5d6c00e44f4c901da0cf4015db916eca03?ds=inline;hp=-c Merge branch 'cc/tests-without-assuming-ref-files-backend' Instead of mucking with filesystem directly, use plumbing commands update-ref etc. to manipulate the refs in the tests. * cc/tests-without-assuming-ref-files-backend: t9104: kosherly remove remote refs --- 90fa1c5d6c00e44f4c901da0cf4015db916eca03 diff --combined t/t9104-git-svn-follow-parent.sh index 9c49b6c1fe,a9734a32bf..5e0ad19177 --- a/t/t9104-git-svn-follow-parent.sh +++ b/t/t9104-git-svn-follow-parent.sh @@@ -33,8 -33,8 +33,8 @@@ test_expect_success 'init and fetch a m git svn fetch -i thunk && test "$(git rev-parse --verify refs/remotes/thunk@2)" \ = "$(git rev-parse --verify refs/remotes/thunk~1)" && - test "$(git cat-file blob refs/remotes/thunk:readme |\ - sed -n -e "3p")" = goodbye && + git cat-file blob refs/remotes/thunk:readme >actual && + test "$(sed -n -e "3p" actual)" = goodbye && test -z "$(git config --get svn-remote.svn.fetch \ "^trunk:refs/remotes/thunk@2$")" ' @@@ -48,8 -48,8 +48,8 @@@ test_expect_success 'init and fetch fro git svn fetch -i svn/thunk && test "$(git rev-parse --verify refs/remotes/svn/trunk)" \ = "$(git rev-parse --verify refs/remotes/svn/thunk~1)" && - test "$(git cat-file blob refs/remotes/svn/thunk:readme |\ - sed -n -e "3p")" = goodbye + git cat-file blob refs/remotes/svn/thunk:readme >actual && + test "$(sed -n -e "3p" actual)" = goodbye ' test_expect_success 'follow deleted parent' ' @@@ -107,8 -107,7 +107,8 @@@ test_expect_success 'follow deleted dir git svn init --minimize-url -i glob "$svnrepo"/glob && git svn fetch -i glob && test "$(git cat-file blob refs/remotes/glob:blob/bye)" = hi && - test "$(git ls-tree refs/remotes/glob | wc -l )" -eq 1 + git ls-tree refs/remotes/glob >actual && + test_line_count = 1 actual ' # ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn) @@@ -205,9 -204,8 +205,9 @@@ test_expect_success "follow-parent is a test_expect_success "track multi-parent paths" ' svn_cmd cp -m "resurrect /glob" "$svnrepo"/r9270 "$svnrepo"/glob && git svn multi-fetch && - test $(git cat-file commit refs/remotes/glob | \ - grep "^parent " | wc -l) -eq 2 + git cat-file commit refs/remotes/glob >actual && + grep "^parent " actual >actual2 && + test_line_count = 2 actual2 ' test_expect_success "multi-fetch continues to work" " @@@ -215,7 -213,9 +215,9 @@@ " 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