From 7be1d62c6f6b322d826d145762db0050057aeb69 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 23 Sep 2006 03:40:17 -0700 Subject: Add t5510 to test per branch configuration affecting git-fetch. Signed-off-by: Junio C Hamano --- t/t5510-fetch.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 t/t5510-fetch.sh (limited to 't/t5510-fetch.sh') diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh new file mode 100755 index 0000000000..e71581a95d --- /dev/null +++ b/t/t5510-fetch.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Copyright (c) 2006, Junio C Hamano. + +test_description='Per branch config variables affects "git fetch". + +' + +. ./test-lib.sh + +D=`pwd` + +test_expect_success setup ' + echo >file original && + git add file && + git commit -a -m original' + +test_expect_success "clone and setup child repos" ' + git clone . one && + cd one && + echo >file updated by one && + git commit -a -m "updated by one" && + cd .. && + git clone . two && + cd two && + git repo-config branch.master.remote one && + { + echo "URL: ../one/.git/" + echo "Pull: refs/heads/master:refs/heads/one" + } >.git/remotes/one +' + +test_expect_success "fetch test" ' + cd "$D" && + echo >file updated by origin && + git commit -a -m "updated by origin" && + cd two && + git fetch && + test -f .git/refs/heads/one && + mine=`git rev-parse refs/heads/one` && + his=`cd ../one && git rev-parse refs/heads/master` && + test "z$mine" = "z$his" +' + +test_done -- cgit v1.2.1 From 6cc7c36d5e2fd89be596a164bcc2afede9d855d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santi=20B=C3=A9jar?= Date: Sat, 23 Sep 2006 22:55:35 +0200 Subject: Add test for the default merges in fetch. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [jc: with minor fix-ups] Signed-off-by: Santi BĂ©jar Signed-off-by: Junio C Hamano --- t/t5510-fetch.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 't/t5510-fetch.sh') diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index e71581a95d..df0ae4811b 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -27,6 +27,16 @@ test_expect_success "clone and setup child repos" ' echo "URL: ../one/.git/" echo "Pull: refs/heads/master:refs/heads/one" } >.git/remotes/one + cd .. && + git clone . three && + cd three && + git repo-config branch.master.remote two && + git repo-config branch.master.merge refs/heads/one && + { + echo "URL: ../two/.git/" + echo "Pull: refs/heads/master:refs/heads/two" + echo "Pull: refs/heads/one:refs/heads/one" + } >.git/remotes/two ' test_expect_success "fetch test" ' @@ -41,4 +51,19 @@ test_expect_success "fetch test" ' test "z$mine" = "z$his" ' +test_expect_success "fetch test for-merge" ' + cd "$D" && + cd three && + git fetch && + test -f .git/refs/heads/two && + test -f .git/refs/heads/one && + master_in_two=`cd ../two && git rev-parse master` && + one_in_two=`cd ../two && git rev-parse one` && + { + echo "$master_in_two not-for-merge" + echo "$one_in_two " + } >expected && + cut -f -2 .git/FETCH_HEAD >actual && + diff expected actual' + test_done -- cgit v1.2.1 From 6c96c0f1940b0247530d21b10042d16bf1e7b769 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 18 Nov 2006 21:39:17 -0800 Subject: git-fetch: follow lightweit tags as well. This side-ports commit fd19f620 from Cogito, in which I fixed exactly the same bug. Somehow nobody noticed this for a long time in git. Signed-off-by: Junio C Hamano --- t/t5510-fetch.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 't/t5510-fetch.sh') diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index df0ae4811b..a11ab0ad41 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -66,4 +66,20 @@ test_expect_success "fetch test for-merge" ' cut -f -2 .git/FETCH_HEAD >actual && diff expected actual' +test_expect_success 'fetch following tags' ' + + cd "$D" && + git tag -a -m 'annotated' anno HEAD && + git tag light HEAD && + + mkdir four && + cd four && + git init-db && + + git fetch .. :track && + git show-ref --verify refs/tags/anno && + git show-ref --verify refs/tags/light + +' + test_done -- cgit v1.2.1 From 75c384efb52d0e3eb1e8c2f53668b4066fe6a8d6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 19 Dec 2006 01:50:37 -0800 Subject: Do not create $GIT_DIR/remotes/ directory anymore. Because we do not use --no-separate-remote anymore, there is no reason to create that directory from the template. t5510 test is updated to test both $GIT_DIR/remotes/ based configuration and $GIT_DIR/config variable (credits to Johannes). Signed-off-by: Junio C Hamano --- t/t5510-fetch.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 't/t5510-fetch.sh') diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index a11ab0ad41..90eeeba2a3 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -23,15 +23,14 @@ test_expect_success "clone and setup child repos" ' git clone . two && cd two && git repo-config branch.master.remote one && - { - echo "URL: ../one/.git/" - echo "Pull: refs/heads/master:refs/heads/one" - } >.git/remotes/one + git repo-config remote.one.url ../one/.git/ && + git repo-config remote.one.fetch refs/heads/master:refs/heads/one && cd .. && git clone . three && cd three && git repo-config branch.master.remote two && git repo-config branch.master.merge refs/heads/one && + mkdir -p .git/remotes && { echo "URL: ../two/.git/" echo "Pull: refs/heads/master:refs/heads/two" -- cgit v1.2.1 From 5c94f87e6b17cab5d3b87998d6c907745cb6f5a4 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 12 Jan 2007 16:01:46 -0500 Subject: use 'init' instead of 'init-db' for shipped docs and tools While 'init-db' still is and probably will always remain a valid git command for obvious backward compatibility reasons, it would be a good idea to move shipped tools and docs to using 'init' instead. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- t/t5510-fetch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t5510-fetch.sh') diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 90eeeba2a3..3ce9446210 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -73,7 +73,7 @@ test_expect_success 'fetch following tags' ' mkdir four && cd four && - git init-db && + git init && git fetch .. :track && git show-ref --verify refs/tags/anno && -- cgit v1.2.1