Skip to content

Commit

Permalink
t5510: prepare test refs more straightforwardly
Browse files Browse the repository at this point in the history
"git fetch" was being used with contrived refspecs to create tags and
remote-tracking branches in test repositories in preparation for the
actual tests.  This is obscure and also makes one wonder whether this
is indeed just preparation or whether some side-effect of "git fetch"
is being tested.

So use the more straightforward commands "git tag" / "git update-ref"
when preparing branches in test repositories.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Oct 24, 2013
1 parent 2004658 commit d0d06e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions t/t5510-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test_expect_success 'fetch --prune on its own works as expected' '
cd "$D" &&
git clone . prune &&
cd prune &&
git fetch origin refs/heads/master:refs/remotes/origin/extrabranch &&
git update-ref refs/remotes/origin/extrabranch master &&
git fetch --prune origin &&
test_must_fail git rev-parse origin/extrabranch
Expand All @@ -98,7 +98,7 @@ test_expect_success 'fetch --prune with a branch name keeps branches' '
cd "$D" &&
git clone . prune-branch &&
cd prune-branch &&
git fetch origin refs/heads/master:refs/remotes/origin/extrabranch &&
git update-ref refs/remotes/origin/extrabranch master &&
git fetch --prune origin master &&
git rev-parse origin/extrabranch
Expand All @@ -117,7 +117,7 @@ test_expect_success 'fetch --prune --tags does not delete the remote-tracking br
cd "$D" &&
git clone . prune-tags &&
cd prune-tags &&
git fetch origin refs/heads/master:refs/tags/sometag &&
git tag sometag master &&
git fetch --prune --tags origin &&
git rev-parse origin/master &&
Expand All @@ -128,7 +128,7 @@ test_expect_success 'fetch --prune --tags with branch does not delete other remo
cd "$D" &&
git clone . prune-tags-branch &&
cd prune-tags-branch &&
git fetch origin refs/heads/master:refs/remotes/origin/extrabranch &&
git update-ref refs/remotes/origin/extrabranch master &&
git fetch --prune --tags origin master &&
git rev-parse origin/extrabranch
Expand Down

0 comments on commit d0d06e8

Please sign in to comment.