checkout: generalize die_if_checked_out() branch name argument
[gitweb.git] / builtin / repack.c
index 2aae05d36486bd31666853c545c37f1280ee11c9..9c04e1d8ec1c2e4ffe03c6ab1c0e7d8215f9788f 100644 (file)
@@ -209,6 +209,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        argv_array_push(&cmd_args, "--non-empty");
        argv_array_push(&cmd_args, "--all");
        argv_array_push(&cmd_args, "--reflog");
+       argv_array_push(&cmd_args, "--indexed-objects");
        if (window)
                argv_array_pushf(&cmd_args, "--window=%s", window);
        if (window_memory)
@@ -283,7 +284,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        failed = 0;
        for_each_string_list_item(item, &names) {
                for (ext = 0; ext < ARRAY_SIZE(exts); ext++) {
-                       char *fname, *fname_old;
+                       const char *fname_old;
+                       char *fname;
                        fname = mkpathdup("%s/pack-%s%s", packdir,
                                                item->string, exts[ext].name);
                        if (!file_exists(fname)) {
@@ -311,7 +313,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        if (failed) {
                struct string_list rollback_failure = STRING_LIST_INIT_DUP;
                for_each_string_list_item(item, &rollback) {
-                       char *fname, *fname_old;
+                       const char *fname_old;
+                       char *fname;
                        fname = mkpathdup("%s/%s", packdir, item->string);
                        fname_old = mkpath("%s/old-%s", packdir, item->string);
                        if (rename(fname_old, fname))
@@ -364,7 +367,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        /* Remove the "old-" files */
        for_each_string_list_item(item, &names) {
                for (ext = 0; ext < ARRAY_SIZE(exts); ext++) {
-                       char *fname;
+                       const char *fname;
                        fname = mkpath("%s/old-%s%s",
                                        packdir,
                                        item->string,