summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-05-17 22:51:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-17 23:13:10 (GMT)
commitc88134870e8b2da084e37fb86ff88fb7d7617d61 (patch)
treeccc6e0b810e3e986d69652538b05dfe24c0c0a35 /builtin/pack-objects.c
parent22bdc7c4ff28452283c150b627ed12a6ee370532 (diff)
downloadgit-c88134870e8b2da084e37fb86ff88fb7d7617d61.zip
git-c88134870e8b2da084e37fb86ff88fb7d7617d61.tar.gz
git-c88134870e8b2da084e37fb86ff88fb7d7617d61.tar.bz2
shallow: add repository argument to is_repository_shallow
Add a repository argument to allow callers of is_repository_shallow to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 97a5963..0f1eec2 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2857,7 +2857,7 @@ static void get_object_list(int ac, const char **av)
setup_revisions(ac, av, &revs, NULL);
/* make sure shallows are read */
- is_repository_shallow();
+ is_repository_shallow(the_repository);
while (fgets(line, sizeof(line), stdin) != NULL) {
int len = strlen(line);
@@ -3142,7 +3142,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
use_bitmap_index = use_bitmap_index_default;
/* "hard" reasons not to use bitmaps; these just won't work at all */
- if (!use_internal_rev_list || (!pack_to_stdout && write_bitmap_index) || is_repository_shallow())
+ if (!use_internal_rev_list || (!pack_to_stdout && write_bitmap_index) || is_repository_shallow(the_repository))
use_bitmap_index = 0;
if (pack_to_stdout || !rev_list_all)