Code

Convert memset(hash,0,20) to hashclr(hash).
[git.git] / cache.h
diff --git a/cache.h b/cache.h
index f99254bf991af312e2e15aa279e75db4a3b1dbdd..e00505a343a2260055f5177bdfd7740e2d5a5e33 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -218,6 +218,14 @@ static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
 {
        return memcmp(sha1, sha2, 20);
 }
+static inline void hashcpy(unsigned char *sha_dst, const unsigned char *sha_src)
+{
+       memcpy(sha_dst, sha_src, 20);
+}
+static inline void hashclr(unsigned char *hash)
+{
+       memset(hash, 0, 20);
+}
 
 int git_mkstemp(char *path, size_t n, const char *template);
 
@@ -388,6 +396,7 @@ extern char git_default_name[MAX_GITNAME];
 extern char git_commit_encoding[MAX_ENCODING_LENGTH];
 
 extern int copy_fd(int ifd, int ofd);
+extern void write_or_die(int fd, const void *buf, size_t count);
 
 /* Finish off pack transfer receiving end */
 extern int receive_unpack_pack(int fd[2], const char *me, int quiet, int);