summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2019-11-13 00:34:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-13 02:48:47 (GMT)
commite362fadcd03753471cf8e7fc91d6d721b7423b8f (patch)
tree8b9bbf166b6c4c9555f91ceb7ee22c38fe74d582 /builtin
parent6462d5eb9a5b23ab9cff4e3c92ff930600562d8f (diff)
downloadgit-e362fadcd03753471cf8e7fc91d6d721b7423b8f.zip
git-e362fadcd03753471cf8e7fc91d6d721b7423b8f.tar.gz
git-e362fadcd03753471cf8e7fc91d6d721b7423b8f.tar.bz2
clone: remove fetch_if_missing=0
Commit 6462d5eb9a ("fetch: remove fetch_if_missing=0", 2019-11-08) strove to remove the need for fetch_if_missing=0 from the fetching mechanism, so it is plausible to attempt removing fetch_if_missing=0 from clone as well. But doing so reveals a bug - when the server does not send an object directly pointed to by a ref, this should be an error, not a trigger for a lazy fetch. (This case in the fetching mechanism was covered by a test using "git clone", not "git fetch", which is why the aforementioned commit didn't uncover the bug.) The bug can be fixed by suppressing lazy-fetching during the connectivity check. Fix this bug, and remove fetch_if_missing from clone. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index c46ee29..8bf12ce 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -927,8 +927,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
struct argv_array ref_prefixes = ARGV_ARRAY_INIT;
- fetch_if_missing = 0;
-
packet_trace_identity("clone");
argc = parse_options(argc, argv, prefix, builtin_clone_options,
builtin_clone_usage, 0);
@@ -1265,7 +1263,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
}
junk_mode = JUNK_LEAVE_REPO;
- fetch_if_missing = 1;
err = checkout(submodule_progress);
strbuf_release(&reflog_msg);