diff mbox series

[v3,1/4] upload-pack: run is_repository_shallow() before setup_revisions()

Message ID patch-1.4-3840ac28e8d-20210621T150651Z-avarab@gmail.com (mailing list archive)
State New
Headers show
Series pack-objects: use revision.c's --stdin parsing | expand

Commit Message

Ævar Arnfjörð Bjarmason June 21, 2021, 3:10 p.m. UTC
Move the is_repository_shallow() added in b790e0f67cd (upload-pack:
send shallow info over stdin to pack-objects, 2014-03-11) to above

Running is_repository_shallow() before setup_revisions() doesn't
matter now, but in subsequent commits we'll make the code that
followed setup_revisions() happen inside a callback in that
function. This isolated change documents that re-arranging this part
of the code is OK in isolation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
 builtin/pack-objects.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 65579e09fe0..a4e2ae059c0 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3767,11 +3767,12 @@  static void get_object_list(int ac, const char **av)
 	repo_init_revisions(the_repository, &revs, NULL);
 	save_commit_buffer = 0;
-	setup_revisions(ac, av, &revs, &s_r_opt);
 	/* make sure shallows are read */
+	setup_revisions(ac, av, &revs, &s_r_opt);
 	save_warning = warn_on_object_refname_ambiguity;
 	warn_on_object_refname_ambiguity = 0;