aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-10-10 23:22:01 -0700
committerJunio C Hamano <junkio@cox.net>2005-10-10 23:22:01 -0700
commitb721e01f6efd84b04c6946553cd566f2707c964d (patch)
tree4f34bf130613e28cb2391efdcf270d885412ec0a /cache.h
parent031260064840e6e8c6bc36d7856a091ba80330c2 (diff)
downloadgit-b721e01f6efd84b04c6946553cd566f2707c964d.tar.gz
git-b721e01f6efd84b04c6946553cd566f2707c964d.tar.xz
Use the same move_temp_to_file in git-http-fetch.
The http commit walker cannot use the same temporary file creation code because it needs to use predictable temporary filename for partial fetch continuation purposes, but the code to move the temporary file to the final location should be usable from the ordinary object creation codepath. Export move_temp_to_file from sha1_file.c and use it, while losing the custom relink_or_rename function from http-fetch.c. Also the temporary object file creation part needs to make sure the leading path exists, in preparation of the really lazy fan-out directory creation. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 0571282e8..64cbcac5b 100644
--- a/cache.h
+++ b/cache.h
@@ -223,6 +223,7 @@ extern int read_tree(void *buffer, unsigned long size, int stage, const char **p
extern int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,
size_t bufsize, size_t *bufposn);
extern int write_sha1_to_fd(int fd, const unsigned char *sha1);
+extern int move_temp_to_file(const char *tmpfile, char *filename);
extern int has_sha1_pack(const unsigned char *sha1);
extern int has_sha1_file(const unsigned char *sha1);