git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Jeff King <peff@peff.net>,
	Sverre Rabbelier <srabbelier@gmail.com>,
	Pieter de Bie <pdebie@ai.rug.nl>,
	git@vger.kernel.org
Subject: Re: What's cooking in git.git (Jan 2009, #07; Wed, 28)
Date: Thu, 12 Feb 2009 13:04:00 -0800	[thread overview]
Message-ID: <7vzlgrjrjz.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: alpine.DEB.1.00.0902121200420.10279@pacific.mpi-cbg.de

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> diff --git a/builtin-clone.c b/builtin-clone.c
>> index f73029e..431c136 100644
>> --- a/builtin-clone.c
>> +++ b/builtin-clone.c
>> @@ -350,6 +350,18 @@ static struct ref *write_remote_refs(const struct ref *refs,
>>  	return local_refs;
>>  }
>>  
>> +static void install_branch_config(const char *origin, const char *local,
>> +				  const char *remote)
>
> I would have used a different order (local, origin, remote), but that's 
> okay, I guess.

Ok, here is an incremental that will be squashed.

 builtin-clone.c  |    7 ++++---
 t/t5601-clone.sh |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/builtin-clone.c b/builtin-clone.c
index 431c136..c338910 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -350,7 +350,8 @@ static struct ref *write_remote_refs(const struct ref *refs,
 	return local_refs;
 }
 
-static void install_branch_config(const char *origin, const char *local,
+static void install_branch_config(const char *local,
+				  const char *origin,
 				  const char *remote)
 {
 	struct strbuf key = STRBUF_INIT;
@@ -552,7 +553,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		remote_head = NULL;
 		option_no_checkout = 1;
 		if (!option_bare)
-			install_branch_config(option_origin, "master",
+			install_branch_config("master", option_origin,
 					      "refs/heads/master");
 	}
 
@@ -582,7 +583,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 				      head_points_at->peer_ref->name,
 				      reflog_msg.buf);
 
-			install_branch_config(option_origin, head,
+			install_branch_config(head, option_origin,
 					      head_points_at->name);
 		}
 	} else if (remote_head) {
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index fe287d3..44793f2 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -144,4 +144,19 @@ test_expect_success 'clone to an existing path' '
 	test_must_fail git clone src target-5
 '
 
+test_expect_success 'clone a void' '
+	mkdir src-0 &&
+	(
+		cd src-0 && git init
+	) &&
+	git clone src-0 target-6 &&
+	(
+		cd src-0 && test_commit A
+	) &&
+	git clone src-0 target-7 &&
+	# There is no reason to insist they are bit-for-bit
+	# identical, but this test should suffice for now.
+	test_cmp target-6/.git/config target-7/.git/config
+'
+
 test_done

  reply	other threads:[~2009-02-12 21:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29  2:06 What's cooking in git.git (Jan 2009, #07; Wed, 28) Junio C Hamano
2009-01-29  3:38 ` Jeff King
2009-01-29  3:51 ` Jeff King
2009-01-29  4:02   ` Jeff King
2009-01-29  4:22     ` Junio C Hamano
2009-01-29 11:27   ` Sverre Rabbelier
2009-01-29 11:37     ` Jeff King
2009-01-29 11:40       ` Pieter de Bie
2009-01-29 11:45         ` Sverre Rabbelier
2009-01-29 11:50           ` Jeff King
2009-01-29 12:20             ` Sverre Rabbelier
2009-01-30  4:51               ` Jeff King
2009-01-30 13:18                 ` Johannes Schindelin
2009-01-30 16:26                   ` Jeff King
2009-02-01  1:31                   ` Junio C Hamano
2009-02-12  6:42                     ` Junio C Hamano
2009-02-12 10:51                       ` Sverre Rabbelier
2009-02-12 11:04                       ` Johannes Schindelin
2009-02-12 21:04                         ` Junio C Hamano [this message]
2009-02-12 21:51                           ` Johannes Schindelin
2009-02-12 12:32                       ` Jeff King
2009-01-29 11:48         ` Jeff King
2009-01-29 12:04           ` Nico -telmich- Schottelius
2009-01-30  4:59             ` Jeff King
2009-01-29  8:14 ` Charles Bailey
2009-01-29  8:26   ` Junio C Hamano
2009-01-29  9:16     ` Charles Bailey
2009-01-30 16:32       ` Charles Bailey
2009-02-01 17:45 ` Kirill Smelkov
2009-02-01 21:34   ` 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=7vzlgrjrjz.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=pdebie@ai.rug.nl \
    --cc=peff@peff.net \
    --cc=srabbelier@gmail.com \
    /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).