Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff.c: make binary patch reversible.
author
Junio C Hamano
<junkio@cox.net>
Wed, 16 Aug 2006 23:08:14 +0000
(16:08 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Thu, 17 Aug 2006 04:08:45 +0000
(21:08 -0700)
This matches the format previous "git-apply --reverse" update
expects.
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
03eb8f8
)
diff --git
a/diff.c
b/diff.c
index 7a238d023336d4340efd67534dae4ed23dd5d3c0..b8161960e6dbee0b8ad13bd1f34bfc843c69c8f5 100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-838,7
+838,7
@@
static unsigned char *deflate_it(char *data,
return deflated;
}
return deflated;
}
-static void emit_binary_diff(mmfile_t *one, mmfile_t *two)
+static void emit_binary_diff
_body
(mmfile_t *one, mmfile_t *two)
{
void *cp;
void *delta;
{
void *cp;
void *delta;
@@
-849,7
+849,6
@@
static void emit_binary_diff(mmfile_t *one, mmfile_t *two)
unsigned long deflate_size;
unsigned long data_size;
unsigned long deflate_size;
unsigned long data_size;
- printf("GIT binary patch\n");
/* We could do deflated delta, or we could do just deflated two,
* whichever is smaller.
*/
/* We could do deflated delta, or we could do just deflated two,
* whichever is smaller.
*/
@@
-898,6
+897,13
@@
static void emit_binary_diff(mmfile_t *one, mmfile_t *two)
free(data);
}
free(data);
}
+static void emit_binary_diff(mmfile_t *one, mmfile_t *two)
+{
+ printf("GIT binary patch\n");
+ emit_binary_diff_body(one, two);
+ emit_binary_diff_body(two, one);
+}
+
#define FIRST_FEW_BYTES 8000
static int mmfile_is_binary(mmfile_t *mf)
{
#define FIRST_FEW_BYTES 8000
static int mmfile_is_binary(mmfile_t *mf)
{