Skip to content

Commit 95b87e1

Browse files
mjcheethamdscho
authored andcommitted
builtin/repack.c: emit warning when shared cache is present
Emit a warning message when the `gvfs.sharedCache` option is set that the `repack` command will not perform repacking on the shared cache. In the future we can teach `repack` to operate on the shared cache, at which point we can drop this commit. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
1 parent 7f0fc0c commit 95b87e1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

builtin/repack.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "pack-bitmap.h"
2525
#include "refs.h"
2626
#include "list-objects-filter-options.h"
27+
#include "gvfs.h"
2728

2829
#define ALL_INTO_ONE 1
2930
#define LOOSEN_UNREACHABLE 2
@@ -1145,6 +1146,7 @@ int cmd_repack(int argc,
11451146
struct tempfile *refs_snapshot = NULL;
11461147
int i, ext, ret;
11471148
int show_progress;
1149+
const char *tmp_obj_dir = NULL;
11481150

11491151
/* variables to be filled by option parsing */
11501152
int delete_redundant = 0;
@@ -1273,6 +1275,10 @@ int cmd_repack(int argc,
12731275
write_bitmaps = 0;
12741276
}
12751277

1278+
if (gvfs_config_is_set(GVFS_ANY_MASK) &&
1279+
!git_config_get_value("gvfs.sharedcache", &tmp_obj_dir))
1280+
warning(_("shared object cache is configured but will not be repacked"));
1281+
12761282
if (write_midx && write_bitmaps) {
12771283
struct strbuf path = STRBUF_INIT;
12781284

gvfs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#define GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS (1 << 6)
3131
#define GVFS_PREFETCH_DURING_FETCH (1 << 7)
3232

33+
#define GVFS_ANY_MASK 0xFFFFFFFF
34+
3335
void gvfs_load_config_value(const char *value);
3436
int gvfs_config_is_set(int mask);
3537

0 commit comments

Comments
 (0)