summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-04-11 13:09:55 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-04-11 13:09:55 +0900
commit3a1ec60c43b1cad73fed8040aed7117900e9fd9d (patch)
tree596ad53743761ff1ea09a80cf3f154aafa615f08 /builtin
parentMerge branch 'sb/object-store' (diff)
parentpackfile: keep prepare_packed_git() private (diff)
downloadtgif-3a1ec60c43b1cad73fed8040aed7117900e9fd9d.tar.xz
Merge branch 'sb/packfiles-in-repository'
Refactoring of the internal global data structure continues. * sb/packfiles-in-repository: packfile: keep prepare_packed_git() private packfile: allow find_pack_entry to handle arbitrary repositories packfile: add repository argument to find_pack_entry packfile: allow reprepare_packed_git to handle arbitrary repositories packfile: allow prepare_packed_git to handle arbitrary repositories packfile: allow prepare_packed_git_one to handle arbitrary repositories packfile: add repository argument to reprepare_packed_git packfile: add repository argument to prepare_packed_git packfile: add repository argument to prepare_packed_git_one packfile: allow install_packed_git to handle arbitrary repositories packfile: allow rearrange_packed_git to handle arbitrary repositories packfile: allow prepare_packed_git_mru to handle arbitrary repositories
Diffstat (limited to 'builtin')
-rw-r--r--builtin/count-objects.c3
-rw-r--r--builtin/fsck.c2
-rw-r--r--builtin/gc.c3
-rw-r--r--builtin/pack-objects.c1
-rw-r--r--builtin/pack-redundant.c2
-rw-r--r--builtin/receive-pack.c3
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;
}