]> git.ipfire.org Git - thirdparty/git.git/blobdiff - environment.c
sub-process: move sub-process functions into separate files
[thirdparty/git.git] / environment.c
index 42dc3106d2fae1976dcfdfbf264a1a9ed96a71b6..2fdba76222b8f5744f1ae84fd11e72a7a3c115cf 100644 (file)
@@ -296,18 +296,16 @@ int odb_mkstemp(char *template, size_t limit, const char *pattern)
        return xmkstemp_mode(template, mode);
 }
 
-int odb_pack_keep(char *name, size_t namesz, const unsigned char *sha1)
+int odb_pack_keep(const char *name)
 {
        int fd;
 
-       snprintf(name, namesz, "%s/pack/pack-%s.keep",
-                get_object_directory(), sha1_to_hex(sha1));
        fd = open(name, O_RDWR|O_CREAT|O_EXCL, 0600);
        if (0 <= fd)
                return fd;
 
        /* slow path */
-       safe_create_leading_directories(name);
+       safe_create_leading_directories_const(name);
        return open(name, O_RDWR|O_CREAT|O_EXCL, 0600);
 }