vendor/libgit2/src/delta-apply.c in rugged-0.17.0.b7 vs vendor/libgit2/src/delta-apply.c in rugged-0.18.0.b1
- old
+ new
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2009-2012 the libgit2 contributors
+ * Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#include "common.h"
@@ -31,9 +31,22 @@
r |= (c & 0x7f) << shift;
shift += 7;
} while (c & 0x80);
*delta = d;
*size = r;
+ return 0;
+}
+
+int git__delta_read_header(
+ const unsigned char *delta,
+ size_t delta_len,
+ size_t *base_sz,
+ size_t *res_sz)
+{
+ const unsigned char *delta_end = delta + delta_len;
+ if ((hdr_sz(base_sz, &delta, delta_end) < 0) ||
+ (hdr_sz(res_sz, &delta, delta_end) < 0))
+ return -1;
return 0;
}
int git__delta_apply(
git_rawobj *out,