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

[PATCH v5] clone: respect user supplied origin name when setting up partial clone

From
Xin Li <delphij@google.com>
Date
May 29, 2019, 21:26 UTC
Message-ID
<20190529212643.206908-1-delphij@google.com>
In-Reply-To
<20190529212231.197417-1-delphij@google.com>
Signed-off-by: Xin Li <delphij@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/clone.c  |  2 +-
 t/t5601-clone.sh | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 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..1fae8ae223 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -634,9 +634,8 @@ 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" &&
 
 	rm -rf "$SERVER" client &&
 	test_create_repo "$SERVER" &&
@@ -646,8 +645,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}" &&
 	git clone --filter=blob:limit=0 "$URL" client &&
 
 	git -C client fsck &&
@@ -664,6 +669,11 @@ test_expect_success 'partial clone' '
 	partial_clone server "file://$(pwd)/server"
 '
 
+test_expect_success 'partial clone with -o' '
+	partial_clone_server server &&
+	git clone -o blah --filter=blob:limit=0 "file://$(pwd)/server" 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
Previous: Xin Li
Message 7 of 7 in “Use user supplied origin name for extension.partialcone instead of hardcoded value.”
  1. Use user supplied origin name for extension.partialcone instead of hardcoded value.Xin Li, May 23, 2019
  2. Jonathan NiederMay 24, 2019
  3. clone: respect user supplied origin name when setting up partial cloneXin Li, May 24, 2019
  4. Junio C HamanoMay 29, 2019
  5. clone: respect user supplied origin name when setting up partial cloneXin Li, May 29, 2019
  6. clone: respect user supplied origin name when setting up partial cloneXin Li, May 29, 2019
  7. clone: respect user supplied origin name when setting up partial cloneXin Li, May 29, 2019

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.