]> git.proxmox.com Git - libgit2.git/commitdiff
patch: identify non-binary patches as `NOT_BINARY`
authorEdward Thomson <ethomson@github.com>
Mon, 25 Apr 2016 17:07:18 +0000 (13:07 -0400)
committerEdward Thomson <ethomson@github.com>
Thu, 26 May 2016 18:01:09 +0000 (13:01 -0500)
src/patch_parse.c

index ee75663e67304dd84ddc4e1e47242974864278ab..c5cf9fc5a4616dbf7f66a0a47cb5ef015d71197c 100644 (file)
@@ -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(