Re: [PATCH v2 02/23] t5510: prepare test refs more straightforwardly

2013-10-30 Thread Michael Haggerty
On 10/30/2013 11:57 AM, Ramkumar Ramachandra wrote:
> Michael Haggerty wrote:
>> "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.
> 
> As the test titles indicate, we are exercising the 'fetch --prune'
> functionality. However, I don't see the 'git fetch 
> :' form exercised anywhere else in the file.

I see a couple of examples:

$ grep 'git fetch.*:' t/t5510*.sh
git fetch --prune origin refs/heads/a/*:refs/remotes/origin/a/* &&
git fetch --prune --tags origin
refs/heads/foo/*:refs/remotes/origin/foo/* &&
git fetch .. :track &&
test_must_fail git fetch .. anno:five
git fetch .. six:six
test_must_fail git fetch "$D/bundle1" master:master
git fetch ../bundle2 master:master &&
 git fetch "rsync:$(pwd)/../.git" master:refs/heads/master &&
test_must_fail git fetch . side:master
git fetch --update-head-ok . side:master

The tests in question didn't really check the results of the fetch
anyway.  I don't think they were intended to test fetch but only to set
up the initial conditions for the real test.

Michael

-- 
Michael Haggerty
mhag...@alum.mit.edu
http://softwareswirl.blogspot.com/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 02/23] t5510: prepare test refs more straightforwardly

2013-10-30 Thread Ramkumar Ramachandra
Michael Haggerty wrote:
> "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.

As the test titles indicate, we are exercising the 'fetch --prune'
functionality. However, I don't see the 'git fetch 
:' form exercised anywhere else in the file.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 02/23] t5510: prepare test refs more straightforwardly

2013-10-29 Thread Michael Haggerty
"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 
---
 t/t5510-fetch.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index c5e5dfc..08d8dbb 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -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
@@ -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
@@ -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 &&
@@ -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
-- 
1.8.4.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html