git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] Fetch: default remote repository from branch properties

From
Junio C Hamano <junkio@cox.net>
Date
Sep 23, 2006, 10:40 UTC
Message-ID
<7vr6y2uaqi.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<87r6y2x5hk.fsf@gmail.com>
You would need a new test in the testsuite for this.

-- >8 -- [PATCH] Add t5510 to test per branch configuration affecting git-fetch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 t/t5510-fetch.sh |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
new file mode 100755
index 0000000..e71581a
--- /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
-- 
1.4.2.1.ga89e
Previous: Santi BéjarNext: Santi Béjar
Message 3 of 5 in “Fetch: branch properties.”
  1. 0/2 Fetch: branch properties.Santi Béjar, Sep 23, 2006
  2. 1/2 Fetch: default remote repository from branch propertiesSanti Béjar, Sep 23, 2006
  3. Junio C HamanoSep 23, 2006
  4. 2/2 Fetch: get the remote branches to merge from the branch propertiesSanti Béjar, Sep 23, 2006
  5. Junio C HamanoSep 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.