提交 962537a3 编写于 作者: J Junio C Hamano

diff-delta.c: allow delta with empty blob.

Delta computation with an empty blob used to punt and returned NULL.
This commit allows creation with empty blob; all combination of
empty->empty, empty->something, and something->empty are allowed.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 e726715a
......@@ -9,8 +9,8 @@ extern void *patch_delta(void *src_buf, unsigned long src_size,
void *delta_buf, unsigned long delta_size,
unsigned long *dst_size);
/* the smallest possible delta size is 4 bytes */
#define DELTA_SIZE_MIN 4
/* the smallest possible delta size is 2 bytes (empty to empty) */
#define DELTA_SIZE_MIN 2
/*
* This must be called twice on the delta data buffer, first to get the
......
......@@ -213,7 +213,7 @@ void *diff_delta(void *from_buf, unsigned long from_size,
bdrecord_t *brec;
bdfile_t bdf;
if (!from_size || !to_size || delta_prepare(from_buf, from_size, &bdf))
if (delta_prepare(from_buf, from_size, &bdf))
return NULL;
outpos = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册