path: root/commit.h
diff options
authorJonathan Tan <>2019-03-26 19:31:20 (GMT)
committerJunio C Hamano <>2019-04-01 06:35:54 (GMT)
commit1e7d440b0a07ec8e71c107d0950ed1dc43b4d20c (patch)
treee6ece4073a5a0029860d33d740a3f84ae7311c9a /commit.h
parenta51423bc68a11560519d275885122ed61cf7b041 (diff)
fetch-pack: call prepare_shallow_info only if v0
In fetch_pack(), be clearer that there is no shallow information before the fetch when v2 is used - memset the struct shallow_info to 0 instead of calling prepare_shallow_info(). This patch is in preparation for a future patch in which a v2 fetch might call prepare_shallow_info() after shallow info has been retrieved during the fetch, so I needed to ensure that prepare_shallow_info() is not called before the fetch. Signed-off-by: Jonathan Tan <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'commit.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/commit.h b/commit.h
index 42728c2..a3f2b2e 100644
--- a/commit.h
+++ b/commit.h
@@ -257,6 +257,10 @@ extern void setup_alternate_shallow(struct lock_file *shallow_lock,
extern const char *setup_temporary_shallow(const struct oid_array *extra);
extern void advertise_shallow_grafts(int);
+ * Initialize with prepare_shallow_info() or zero-initialize (equivalent to
+ * prepare_shallow_info with a NULL oid_array).
+ */
struct shallow_info {
struct oid_array *shallow;
int *ours, nr_ours;