From 6a1a79fd146510a7f1a6e6303d5adb1f8f298989 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 15 May 2018 16:42:16 -0700 Subject: object: move grafts to object parser Grafts are only meaningful in the context of a single repository. Therefore they cannot be global. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- object.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'object.h') diff --git a/object.h b/object.h index 7916edb4ed..ec908f9bcc 100644 --- a/object.h +++ b/object.h @@ -12,6 +12,10 @@ struct parsed_object_pool { struct alloc_state *tag_state; struct alloc_state *object_state; unsigned commit_count; + + /* parent substitutions from .git/info/grafts and .git/shallow */ + struct commit_graft **grafts; + int grafts_alloc, grafts_nr; }; struct parsed_object_pool *parsed_object_pool_new(void); -- cgit v1.2.3 From eee4502baaf8f82c20bcda70625df56ce68dd9b1 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 17 May 2018 15:51:52 -0700 Subject: shallow: migrate shallow information into the object parser We need to convert the shallow functions all at the same time as we move the data structures they operate on into the repository. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- object.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'object.h') diff --git a/object.h b/object.h index ec908f9bcc..a314331aca 100644 --- a/object.h +++ b/object.h @@ -16,6 +16,10 @@ struct parsed_object_pool { /* parent substitutions from .git/info/grafts and .git/shallow */ struct commit_graft **grafts; int grafts_alloc, grafts_nr; + + int is_shallow; + struct stat_validity *shallow_stat; + char *alternate_shallow_file; }; struct parsed_object_pool *parsed_object_pool_new(void); -- cgit v1.2.3 From 2f6c767fd49a1fb324c2d19fcee1fe227d816e11 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 17 May 2018 15:51:53 -0700 Subject: commit: allow prepare_commit_graft to handle arbitrary repositories Move the global variable 'commit_graft_prepared' into the object pool and convert the function prepare_commit_graft to work an arbitrary repositories. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- object.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'object.h') diff --git a/object.h b/object.h index a314331aca..4af499ab03 100644 --- a/object.h +++ b/object.h @@ -20,6 +20,8 @@ struct parsed_object_pool { int is_shallow; struct stat_validity *shallow_stat; char *alternate_shallow_file; + + int commit_graft_prepared; }; struct parsed_object_pool *parsed_object_pool_new(void); -- cgit v1.2.3