Skip to content

Commit 3ca0cb9

Browse files
committed
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 may teach `repack` to operate on the shared cache, at which point we can drop this commit. Signed-off-by: Matthew John Cheetham <[email protected]>
1 parent 9df7c2a commit 3ca0cb9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-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
@@ -1177,6 +1178,7 @@ int cmd_repack(int argc,
11771178
struct tempfile *refs_snapshot = NULL;
11781179
int i, ext, ret;
11791180
int show_progress;
1181+
const char *tmp_obj_dir = NULL;
11801182

11811183
/* variables to be filled by option parsing */
11821184
int delete_redundant = 0;
@@ -1301,6 +1303,10 @@ int cmd_repack(int argc,
13011303
write_bitmaps = 0;
13021304
}
13031305

1306+
if (gvfs_config_is_set(NULL) &&
1307+
!git_config_get_value("gvfs.sharedcache", &tmp_obj_dir))
1308+
warning(_("shared object cache is configured but will not be repacked"));
1309+
13041310
if (write_midx && write_bitmaps) {
13051311
struct strbuf path = STRBUF_INIT;
13061312

0 commit comments

Comments
 (0)