]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-unpack-objects.c
fix openssl headers conflicting with custom SHA1 implementations
[thirdparty/git.git] / builtin-unpack-objects.c
index 40b20f26e86acca2ee37b34519e84a1ce79689c3..d2796b6309d3b13a6c401b502aafd53d684328d8 100644 (file)
@@ -19,7 +19,7 @@ static const char unpack_usage[] = "git unpack-objects [-n] [-q] [-r] [--strict]
 static unsigned char buffer[4096];
 static unsigned int offset, len;
 static off_t consumed_bytes;
-static SHA_CTX ctx;
+static git_SHA_CTX ctx;
 
 /*
  * When running under --strict mode, objects whose reachability are
@@ -59,7 +59,7 @@ static void *fill(int min)
        if (min > sizeof(buffer))
                die("cannot fill %d bytes", min);
        if (offset) {
-               SHA1_Update(&ctx, buffer, offset);
+               git_SHA1_Update(&ctx, buffer, offset);
                memmove(buffer, buffer + offset, len);
                offset = 0;
        }
@@ -539,10 +539,10 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
                /* We don't take any non-flag arguments now.. Maybe some day */
                usage(unpack_usage);
        }
-       SHA1_Init(&ctx);
+       git_SHA1_Init(&ctx);
        unpack_all();
-       SHA1_Update(&ctx, buffer, offset);
-       SHA1_Final(sha1, &ctx);
+       git_SHA1_Update(&ctx, buffer, offset);
+       git_SHA1_Final(sha1, &ctx);
        if (strict)
                write_rest();
        if (hashcmp(fill(20), sha1))