Merge branch 'mw/symlinks'
[gitweb.git] / builtin / repack.c
index a2b9dba5223bc23304cdd3b955e65d80366f09f6..bb2314c9cb0ce3e01372c6c3a27396931c0143ab 100644 (file)
@@ -78,7 +78,7 @@ static void get_non_kept_pack_filenames(struct string_list *fname_list)
                return;
 
        while ((e = readdir(dir)) != NULL) {
-               if (suffixcmp(e->d_name, ".pack"))
+               if (!ends_with(e->d_name, ".pack"))
                        continue;
 
                len = strlen(e->d_name) - strlen(".pack");
@@ -258,7 +258,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        for_each_string_list_item(item, &names) {
                for (ext = 0; ext < 2; ext++) {
                        char *fname, *fname_old;
-                       fname = mkpathdup("%s/%s%s", packdir,
+                       fname = mkpathdup("%s/pack-%s%s", packdir,
                                                item->string, exts[ext]);
                        if (!file_exists(fname)) {
                                free(fname);
@@ -335,7 +335,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        for_each_string_list_item(item, &names) {
                for (ext = 0; ext < 2; ext++) {
                        char *fname;
-                       fname = mkpath("%s/old-pack-%s%s",
+                       fname = mkpath("%s/old-%s%s",
                                        packdir,
                                        item->string,
                                        exts[ext]);