diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-08-28 21:18:48 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-28 21:18:48 -0700 |
commit | 0dc691a4f3dcb67dd948eb97efcf7098059988c1 (patch) | |
tree | 51cc64356b359feb49d19228cd6b1e7cdc0542ae /fast-import.c | |
parent | 05d88e6f7e8eb027a9e0ae77541e80f2346abe4f (diff) | |
parent | 6c447f633cedd6e2366151b0b82b1731f8c1ee1d (diff) | |
download | git-0dc691a4f3dcb67dd948eb97efcf7098059988c1.tar.gz |
Merge branch 'di/fast-import-tagging'
* di/fast-import-tagging:
fast-import: allow to tag newly created objects
fast-import: add tests for tagging blobs
Diffstat (limited to 'fast-import.c')
-rw-r--r-- | fast-import.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fast-import.c b/fast-import.c index 96ccd2aece..742e7da6b8 100644 --- a/fast-import.c +++ b/fast-import.c @@ -2726,13 +2726,13 @@ static void parse_new_tag(void) type = oe->type; hashcpy(sha1, oe->idx.sha1); } else if (!get_sha1(from, sha1)) { - unsigned long size; - char *buf; - - buf = read_sha1_file(sha1, &type, &size); - if (!buf || size < 46) - die("Not a valid commit: %s", from); - free(buf); + struct object_entry *oe = find_object(sha1); + if (!oe) { + type = sha1_object_info(sha1, NULL); + if (type < 0) + die("Not a valid object: %s", from); + } else + type = oe->type; } else die("Invalid ref name or SHA1 expression: %s", from); read_next_command(); |