Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2009-01-23 12:07:26 +0300
committerJunio C Hamano <gitster@pobox.com>2009-06-01 04:02:59 +0400
commitcc400f50112a58471b992a54b1a05d99a8a82457 (patch)
treed6f0e37bf8d3c05630dee2fe3b68bd0f075322bc /mktag.c
parenta3e826722515ec8abed8ccf29d958eb52d4be3f8 (diff)
mktag: call "check_sha1_signature" with the replacement sha1
Otherwise we get a "sha1 mismatch" error for replaced objects. Note that I am not sure at all that this is a good change. It may be that we should just refuse to tag a replaced object. But in this case we should probably give a meaningfull error message instead of "sha1 mismatch". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'mktag.c')
-rw-r--r--mktag.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mktag.c b/mktag.c
index 99a356e9ee..6e0b5feaee 100644
--- a/mktag.c
+++ b/mktag.c
@@ -19,16 +19,17 @@
/*
* We refuse to tag something we can't verify. Just because.
*/
-static int verify_object(unsigned char *sha1, const char *expected_type)
+static int verify_object(const unsigned char *sha1, const char *expected_type)
{
int ret = -1;
enum object_type type;
unsigned long size;
- void *buffer = read_sha1_file(sha1, &type, &size);
+ const unsigned char *repl;
+ void *buffer = read_sha1_file_repl(sha1, &type, &size, &repl);
if (buffer) {
if (type == type_from_string(expected_type))
- ret = check_sha1_signature(sha1, buffer, size, expected_type);
+ ret = check_sha1_signature(repl, buffer, size, expected_type);
free(buffer);
}
return ret;