All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xin Li <delphij@google.com>
To: gitster@pobox.com, jrnieder@gmail.com, git@vger.kernel.org
Cc: Xin Li <delphij@google.com>
Subject: [PATCH v3] clone: respect user supplied origin name when setting up partial clone
Date: Wed, 29 May 2019 14:16:10 -0700	[thread overview]
Message-ID: <20190529211610.190269-1-delphij@google.com> (raw)
In-Reply-To: <xmqqr28hxc9t.fsf@gitster-ct.c.googlers.com>

Signed-off-by: Xin Li <delphij@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c  |  2 +-
 t/t5601-clone.sh | 15 +++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 50bde99618..822208a346 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -1215,7 +1215,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			remote_head_points_at, &branch_top);
 
 	if (filter_options.choice)
-		partial_clone_register("origin", &filter_options);
+		partial_clone_register(option_origin, &filter_options);
 
 	if (is_local)
 		clone_local(path, git_dir);
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index d6948cbdab..3595162c32 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -634,7 +634,7 @@ test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' '
 	test_i18ngrep "the following paths have collided" icasefs/warning
 '
 
-partial_clone () {
+partial_clone_server () {
 	       SERVER="$1" &&
 	       URL="$2" &&
 
@@ -646,8 +646,14 @@ partial_clone () {
 	test_commit -C "$SERVER" two &&
 	HASH2=$(git hash-object "$SERVER/two.t") &&
 	test_config -C "$SERVER" uploadpack.allowfilter 1 &&
-	test_config -C "$SERVER" uploadpack.allowanysha1inwant 1 &&
+	test_config -C "$SERVER" uploadpack.allowanysha1inwant 1
+}
+
+partial_clone () {
+	       SERVER="$1" &&
+	       URL="$2" &&
 
+	partial_clone_server "${SERVER}" "${URL}" &&
 	git clone --filter=blob:limit=0 "$URL" client &&
 
 	git -C client fsck &&
@@ -664,6 +670,11 @@ test_expect_success 'partial clone' '
 	partial_clone server "file://$(pwd)/server"
 '
 
+test_expect_success 'partial clone with -o' '
+	partial_clone_server server "file://$(pwd)/server" &&
+	git clone -o blah --filter=blob:limit=0 "${URL}" client
+'
+
 test_expect_success 'partial clone: warn if server does not support object filtering' '
 	rm -rf server client &&
 	test_create_repo server &&
-- 
2.22.0.rc1.257.g3120a18244-goog


  reply	other threads:[~2019-05-29 21:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 23:55 [PATCH] Use user supplied origin name for extension.partialcone instead of hardcoded value Xin Li
2019-05-24  0:01 ` Jonathan Nieder
2019-05-24  0:15   ` [PATCH] clone: respect user supplied origin name when setting up partial clone Xin Li
2019-05-29 19:59     ` Junio C Hamano
2019-05-29 21:16       ` Xin Li [this message]
2019-05-29 21:22         ` [PATCH v4] " Xin Li
2019-05-29 21:26           ` [PATCH v5] " Xin Li

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=20190529211610.190269-1-delphij@google.com \
    --to=delphij@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.