diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-21 15:07:17 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-21 15:07:17 -0700 |
commit | 45cbc37c5f84fadd78cccf6b2ea82a9ef251cdc6 (patch) | |
tree | 279382ccc172caff7ccd76eb2f0743619063597f /environment.c | |
parent | e15b9606557d590e1cdc1e3b1b9154cce455a4c8 (diff) | |
parent | f20754802a280c57a1e5886605b6805bbf040c63 (diff) | |
download | git-45cbc37c5f84fadd78cccf6b2ea82a9ef251cdc6.tar.gz |
Merge branch 'jk/pack-name-cleanups'
Code clean-up.
* jk/pack-name-cleanups:
index-pack: make pointer-alias fallbacks safer
replace snprintf with odb_pack_name()
odb_pack_keep(): stop generating keepfile name
sha1_file.c: make pack-name helper globally accessible
move odb_* declarations out of git-compat-util.h
Diffstat (limited to 'environment.c')
-rw-r--r-- | environment.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/environment.c b/environment.c index 42dc3106d2..2fdba76222 100644 --- a/environment.c +++ b/environment.c @@ -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); } |