fix 'make test' for HP NonStop
[gitweb.git] / builtin / prune.c
index a9e2241a0260fd93717c5c28fcc4056f9dc729ed..8cb8b9186a3a268630680e4b224d3767017e1e38 100644 (file)
@@ -25,7 +25,8 @@ static int prune_tmp_object(const char *path, const char *filename)
                return error("Could not stat '%s'", fullpath);
        if (st.st_mtime > expire)
                return 0;
-       printf("Removing stale temporary file %s\n", fullpath);
+       if (show_only || verbose)
+               printf("Removing stale temporary file %s\n", fullpath);
        if (!show_only)
                unlink_or_warn(fullpath);
        return 0;
@@ -168,7 +169,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
 
        prune_packed_objects(show_only);
        remove_temporary_files(get_object_directory());
-       s = xstrdup(mkpath("%s/pack", get_object_directory()));
+       s = mkpathdup("%s/pack", get_object_directory());
        remove_temporary_files(s);
        free(s);
        return 0;