Skip to content

Commit

Permalink
diff.c: make binary patch reversible.
Browse files Browse the repository at this point in the history
This matches the format previous "git-apply --reverse" update
expects.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Aug 17, 2006
1 parent 03eb8f8 commit d4c452f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ static unsigned char *deflate_it(char *data,
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;
Expand All @@ -849,7 +849,6 @@ static void emit_binary_diff(mmfile_t *one, mmfile_t *two)
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.
*/
Expand Down Expand Up @@ -898,6 +897,13 @@ static void emit_binary_diff(mmfile_t *one, mmfile_t *two)
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)
{
Expand Down

0 comments on commit d4c452f

Please sign in to comment.