summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-04-25 13:07:18 -0400
committerEdward Thomson <ethomson@github.com>2016-05-26 13:01:09 -0500
commit33ae8762392e6577ee8801a00facaea5abda00f5 (patch)
treecfab0a6757501ea2794d5c8dcb94c74edfaac6de
parent728274904f69fef48752d77c8cf75fc3aaf7808c (diff)
downloadlibgit2-33ae8762392e6577ee8801a00facaea5abda00f5.tar.gz
patch: identify non-binary patches as `NOT_BINARY`
-rw-r--r--src/patch_parse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/patch_parse.c b/src/patch_parse.c
index ee75663e6..c5cf9fc5a 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -810,6 +810,8 @@ static int parse_patch_hunks(
goto done;
}
+ patch->base.delta->flags |= GIT_DIFF_FLAG_NOT_BINARY;
+
done:
return error;
}
@@ -819,11 +821,8 @@ static int parse_patch_body(
{
if (parse_ctx_contains_s(ctx, "GIT binary patch"))
return parse_patch_binary(patch, ctx);
-
- else if (parse_ctx_contains_s(ctx, "@@ -"))
+ else
return parse_patch_hunks(patch, ctx);
-
- return 0;
}
int check_header_names(