summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e726715)
raw | patch | inline | side by side (parent: e726715)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 12 Dec 2005 20:01:52 +0000 (12:01 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 12 Dec 2005 20:57:25 +0000 (12:57 -0800) |
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: Junio C Hamano <junkio@cox.net>
This commit allows creation with empty blob; all combination of
empty->empty, empty->something, and something->empty are allowed.
Signed-off-by: Junio C Hamano <junkio@cox.net>
delta.h | patch | blob | history | |
diff-delta.c | patch | blob | history |
index 31d1820f80f2887d51808170fc86585ada42d42e..c6a476353f7122884cb4769685089d63c886631c 100644 (file)
--- a/delta.h
+++ b/delta.h
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
diff --git a/diff-delta.c b/diff-delta.c
index b2ae7b5e6c3b4aa409ccfa60f67d5c8eb1690504..cf5013896f6ea5efc35c9d7e90d076e4bf6328a5 100644 (file)
--- a/diff-delta.c
+++ b/diff-delta.c
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;