git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Santi Béjar" <sbejar@gmail.com>
To: git <git@vger.kernel.org>
Subject: [PATCH 2/4 (take 4)] Add t5510 to test per branch configuration affecting git-fetch.
Date: Sat, 23 Sep 2006 22:52:17 +0200	[thread overview]
Message-ID: <871wq2fgqm.fsf@gmail.com> (raw)
In-Reply-To: <87ac4qfgvc.fsf@gmail.com> (Santi Béjar's message of "Sat, 23 Sep 2006 22:49:27 +0200")


From: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 I hope the attribution is ok.

 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.g279b

  parent reply	other threads:[~2006-09-23 20:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-23 20:49 [PATCH 0/4 (take 4)] Fetch: branch properties for fetch Santi Béjar
2006-09-23 20:50 ` [PATCH 1/4 (take 4)] fetch: default remote repository from branch properties Santi Béjar
2006-09-23 20:52 ` Santi Béjar [this message]
2006-09-23 20:53 ` [PATCH 3/4 (take 4)] fetch: get the remote branches to merge from the " Santi Béjar
2006-09-23 20:55 ` [PATCH 4/4 (take 4)] Add test for the default merges in fetch Santi Béjar
2006-09-24  1:49   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871wq2fgqm.fsf@gmail.com \
    --to=sbejar@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).