vendor/libgit2/src/patch_parse.c in rugged-1.0.1 vs vendor/libgit2/src/patch_parse.c in rugged-1.1.0
- old
+ new
@@ -196,11 +196,11 @@
parse_header_oid(&patch->base.delta->new_file.id,
&patch->base.delta->new_file.id_abbrev, ctx) < 0)
return -1;
if (git_parse_peek(&c, &ctx->parse_ctx, 0) == 0 && c == ' ') {
- uint16_t mode;
+ uint16_t mode = 0;
git_parse_advance_chars(&ctx->parse_ctx, 1);
if (parse_header_mode(&mode, ctx) < 0)
return -1;
@@ -405,14 +405,16 @@
{ "index " , STATE_DIFF, STATE_INDEX, parse_header_git_index },
{ "index " , STATE_END, STATE_INDEX, parse_header_git_index },
{ "--- " , STATE_DIFF, STATE_PATH, parse_header_git_oldpath },
{ "--- " , STATE_INDEX, STATE_PATH, parse_header_git_oldpath },
+ { "--- " , STATE_FILEMODE, STATE_PATH, parse_header_git_oldpath },
{ "+++ " , STATE_PATH, STATE_END, parse_header_git_newpath },
{ "GIT binary patch" , STATE_INDEX, STATE_END, NULL },
{ "Binary files " , STATE_INDEX, STATE_END, NULL },
+ { "similarity index " , STATE_END, STATE_SIMILARITY, parse_header_similarity },
{ "similarity index " , STATE_DIFF, STATE_SIMILARITY, parse_header_similarity },
{ "dissimilarity index ", STATE_DIFF, STATE_SIMILARITY, parse_header_dissimilarity },
{ "rename from " , STATE_SIMILARITY, STATE_RENAME, parse_header_renamefrom },
{ "rename old " , STATE_SIMILARITY, STATE_RENAME, parse_header_renamefrom },
{ "copy from " , STATE_SIMILARITY, STATE_COPY, parse_header_copyfrom },
@@ -938,10 +940,10 @@
return parse_patch_binary_nodata(patch, ctx);
else
return parse_patch_hunks(patch, ctx);
}
-int check_header_names(
+static int check_header_names(
const char *one,
const char *two,
const char *old_or_new,
bool two_null)
{