Thread (115 messages) flat view 115 messages, 7 authors, 2018-02-27

Re: [PATCH 13/27] sha1_file: add repository argument to prepare_alt_odb

From: Jonathan Nieder <hidden>
Date: 2018-02-22 06:51:29

Possibly related (same subject, not in this thread)

Hi,

Stefan Beller wrote:
See previous patch for explanation.

While at it, move the declaration to object-store.h,
where it should be easier to find.
Which declaration?  It looks like prepare_alt_odb is already in
object-store.h.

[...]
quoted hunk ↗ jump to hunk
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -717,7 +717,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
 	} else {
 		fsck_object_dir(get_object_directory());
 
-		prepare_alt_odb();
+		prepare_alt_odb(the_repository);
Patch 2 added a #include of "repository.h".  Good.

(I checked because with the definition of prepare_alt_odb as a macro,
the function call would compile correctly even if the_repository
weren't in scope, but we want to include what we use as a matter of
style/maintainability.)

[...]
quoted hunk ↗ jump to hunk
--- a/packfile.c
+++ b/packfile.c
@@ -890,7 +890,7 @@ void prepare_packed_git(void)
 	if (the_repository->objects.packed_git_initialized)
 		return;
 	prepare_packed_git_one(get_object_directory(), 1);
-	prepare_alt_odb();
+	prepare_alt_odb(the_repository);
Also good, since patch 3 added a #include of "repository.h".

[...]
quoted hunk ↗ jump to hunk
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -23,6 +23,7 @@
 #include "sha1-lookup.h"
 #include "bulk-checkin.h"
 #include "repository.h"
+#include "object-store.h"
Should this #include have been added in an earlier patch, since the
file both uses and defines prepare_alt_odb, which is declared there?

The rest looks good.

Thanks,
Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help