diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/count-objects.c | 3 | ||||
-rw-r--r-- | builtin/fsck.c | 2 | ||||
-rw-r--r-- | builtin/gc.c | 3 | ||||
-rw-r--r-- | builtin/pack-objects.c | 1 | ||||
-rw-r--r-- | builtin/pack-redundant.c | 2 | ||||
-rw-r--r-- | builtin/receive-pack.c | 3 |
6 files changed, 4 insertions, 10 deletions
diff --git a/builtin/count-objects.c b/builtin/count-objects.c index b28ff00be2..b054713e1a 100644 --- a/builtin/count-objects.c +++ b/builtin/count-objects.c @@ -122,8 +122,7 @@ int cmd_count_objects(int argc, const char **argv, const char *prefix) struct strbuf loose_buf = STRBUF_INIT; struct strbuf pack_buf = STRBUF_INIT; struct strbuf garbage_buf = STRBUF_INIT; - if (!get_packed_git(the_repository)) - prepare_packed_git(); + for (p = get_packed_git(the_repository); p; p = p->next) { if (!p->pack_local) continue; diff --git a/builtin/fsck.c b/builtin/fsck.c index 13c0a8048e..087360a675 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -735,8 +735,6 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) uint32_t total = 0, count = 0; struct progress *progress = NULL; - prepare_packed_git(); - if (show_progress) { for (p = get_packed_git(the_repository); p; p = p->next) { diff --git a/builtin/gc.c b/builtin/gc.c index cef38e5427..3e67124eaa 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -174,7 +174,6 @@ static int too_many_packs(void) if (gc_auto_pack_limit <= 0) return 0; - prepare_packed_git(); for (cnt = 0, p = get_packed_git(the_repository); p; p = p->next) { if (!p->pack_local) continue; @@ -481,7 +480,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) return error(FAILED_RUN, rerere.argv[0]); report_garbage = report_pack_garbage; - reprepare_packed_git(); + reprepare_packed_git(the_repository); if (pack_garbage.nr > 0) clean_pack_garbage(); diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 89f49bb5f6..4bdae5a1d8 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -3148,7 +3148,6 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) if (progress && all_progress_implied) progress = 2; - prepare_packed_git(); if (ignore_packed_keep) { struct packed_git *p; for (p = get_packed_git(the_repository); p; p = p->next) diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c index f060b941b5..354478a127 100644 --- a/builtin/pack-redundant.c +++ b/builtin/pack-redundant.c @@ -631,8 +631,6 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix) break; } - prepare_packed_git(); - if (load_all_packs) load_all(); else diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 19428ef97d..c4272fbc96 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -1,4 +1,5 @@ #include "builtin.h" +#include "repository.h" #include "config.h" #include "lockfile.h" #include "pack.h" @@ -1778,7 +1779,7 @@ static const char *unpack(int err_fd, struct shallow_info *si) status = finish_command(&child); if (status) return "index-pack abnormal exit"; - reprepare_packed_git(); + reprepare_packed_git(the_repository); } return NULL; } |