Skip to content

Commit a49d283

Browse files
stefanbellergitster
authored andcommitted
packfile: add repository argument to reprepare_packed_git
See previous patch for explanation. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6fdb4e9 commit a49d283

File tree

7 files changed

+11
-7
lines changed

7 files changed

+11
-7
lines changed

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
478478
return error(FAILED_RUN, rerere.argv[0]);
479479

480480
report_garbage = report_pack_garbage;
481-
reprepare_packed_git();
481+
reprepare_packed_git(the_repository);
482482
if (pack_garbage.nr > 0)
483483
clean_pack_garbage();
484484

builtin/receive-pack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "builtin.h"
2+
#include "repository.h"
23
#include "config.h"
34
#include "lockfile.h"
45
#include "pack.h"
@@ -1777,7 +1778,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
17771778
status = finish_command(&child);
17781779
if (status)
17791780
return "index-pack abnormal exit";
1780-
reprepare_packed_git();
1781+
reprepare_packed_git(the_repository);
17811782
}
17821783
return NULL;
17831784
}

bulk-checkin.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
#include "cache.h"
55
#include "bulk-checkin.h"
6+
#include "repository.h"
67
#include "csum-file.h"
78
#include "pack.h"
89
#include "strbuf.h"
@@ -57,7 +58,7 @@ static void finish_bulk_checkin(struct bulk_checkin_state *state)
5758

5859
strbuf_release(&packname);
5960
/* Make objects we just wrote available to ourselves */
60-
reprepare_packed_git();
61+
reprepare_packed_git(the_repository);
6162
}
6263

6364
static int already_written(struct bulk_checkin_state *state, unsigned char sha1[])

fetch-pack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "cache.h"
2+
#include "repository.h"
23
#include "config.h"
34
#include "lockfile.h"
45
#include "refs.h"
@@ -1192,7 +1193,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
11921193
prepare_shallow_info(&si, shallow);
11931194
ref_cpy = do_fetch_pack(args, fd, ref, sought, nr_sought,
11941195
&si, pack_lockfile);
1195-
reprepare_packed_git();
1196+
reprepare_packed_git(the_repository);
11961197
update_shallow(args, sought, nr_sought, &si);
11971198
clear_shallow_info(&si);
11981199
return ref_cpy;

packfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ void prepare_packed_git_the_repository(void)
899899
the_repository->objects->packed_git_initialized = 1;
900900
}
901901

902-
void reprepare_packed_git(void)
902+
void reprepare_packed_git_the_repository(void)
903903
{
904904
the_repository->objects->approximate_object_count_valid = 0;
905905
the_repository->objects->packed_git_initialized = 0;

packfile.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ extern void (*report_garbage)(unsigned seen_bits, const char *path);
3636

3737
#define prepare_packed_git(r) prepare_packed_git_##r()
3838
extern void prepare_packed_git_the_repository(void);
39-
extern void reprepare_packed_git(void);
39+
#define reprepare_packed_git(r) reprepare_packed_git_##r()
40+
extern void reprepare_packed_git_the_repository(void);
4041
extern void install_packed_git(struct repository *r, struct packed_git *pack);
4142

4243
struct packed_git *get_packed_git(struct repository *r);

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi,
12741274
return 0;
12751275

12761276
/* Not a loose object; someone else may have just packed it. */
1277-
reprepare_packed_git();
1277+
reprepare_packed_git(the_repository);
12781278
if (find_pack_entry(real, &e))
12791279
break;
12801280

0 commit comments

Comments
 (0)