summaryrefslogtreecommitdiffabout
path: root/ui-diff.c
authorLars Hjemli <hjemli@gmail.com>2007-05-08 20:40:59 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-05-08 21:38:49 (UTC)
commit61c3ca978c586c673aec618cb94210657278dda8 (patch) (side-by-side diff)
tree7011987769e65ad0e7aa8b79f648357e9cd88c30 /ui-diff.c
parent66cacd053ba900c8eb3b7962027370c84a97f990 (diff)
downloadcgit-61c3ca978c586c673aec618cb94210657278dda8.zip
cgit-61c3ca978c586c673aec618cb94210657278dda8.tar.gz
cgit-61c3ca978c586c673aec618cb94210657278dda8.tar.bz2
Update to libgit 1.5.2-rc2
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-diff.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-diff.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ui-diff.c b/ui-diff.c
index b6486f1..0ad9faf 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -1,22 +1,21 @@
/* ui-diff.c: show diff between two blobs
*
* Copyright (C) 2006 Lars Hjemli
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
*/
#include "cgit.h"
-#include "xdiff.h"
char *diff_buffer;
int diff_buffer_size;
/*
* print a single line returned from xdiff
*/
static void print_line(char *line, int len)
{
char *class = "ctx";
char c = line[len-1];
@@ -73,31 +72,31 @@ int diff_cb(void *priv_, mmbuffer_t *mb, int nbuf)
}
if (diff_buffer) {
print_line(diff_buffer, diff_buffer_size);
free(diff_buffer);
diff_buffer = NULL;
diff_buffer_size = 0;
}
return 0;
}
static int load_mmfile(mmfile_t *file, const unsigned char *sha1)
{
- char type[20];
+ enum object_type type;
if (is_null_sha1(sha1)) {
file->ptr = (char *)"";
file->size = 0;
} else {
- file->ptr = read_sha1_file(sha1, type, &file->size);
+ file->ptr = read_sha1_file(sha1, &type, &file->size);
}
return 1;
}
static void run_diff(const unsigned char *sha1, const unsigned char *sha2)
{
mmfile_t file1, file2;
xpparam_t diff_params;
xdemitconf_t emit_params;
xdemitcb_t emit_cb;
if (!load_mmfile(&file1, sha1) || !load_mmfile(&file2, sha2)) {