Subject: [PATCH 4/4 (take 4)] Add test for the default merges in fetch.

From: Santi Béjar <[email-masked]>
Date: Sat, 23 Sep 2006 22:55:35 +0200

Signed-off-by: Santi Béjar <[email-masked]>
---
 t/t5510-fetch.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index e71581a..c7faffe
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -27,6 +27,16 @@ test_expect_success "clone and setup chi
 		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,17 @@ 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 &&
+	{
+		echo -e "not-for-merge	branch \047master\047 of ../two/"
+		echo -e "	branch \047one\047 of ../two/"
+	} > expected &&
+	cut -f 2- .git/FETCH_HEAD > actual &&
+	diff expected actual'
+
 test_done
-- 
1.4.2.1.g279b