projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Require less in RPM spec
[git.git]
/
read-cache.c
diff --git
a/read-cache.c
b/read-cache.c
index
ced5973
..
6eff4c8
100644
(file)
--- a/
read-cache.c
+++ b/
read-cache.c
@@
-462,6
+462,13
@@
static int ce_flush(SHA_CTX *context, int fd)
SHA1_Update(context, write_buffer, left);
}
SHA1_Update(context, write_buffer, left);
}
+ /* Flush first if not enough space for SHA1 signature */
+ if (left + 20 > WRITE_BUFFER_SIZE) {
+ if (write(fd, write_buffer, left) != left)
+ return -1;
+ left = 0;
+ }
+
/* Append the SHA1 signature at the end */
SHA1_Final(write_buffer + left, context);
left += 20;
/* Append the SHA1 signature at the end */
SHA1_Final(write_buffer + left, context);
left += 20;