summaryrefslogtreecommitdiff
path: root/unpack-objects.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-28 16:58:23 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-28 16:58:23 (GMT)
commita69d09436687746a898f86f32c180083f323b616 (patch)
tree33d636080914a5306158b33563e9a09fd6bf68d1 /unpack-objects.c
parent62bb99606d0377fc14f206cbdf95acb57149d87a (diff)
downloadgit-a69d09436687746a898f86f32c180083f323b616.zip
git-a69d09436687746a898f86f32c180083f323b616.tar.gz
git-a69d09436687746a898f86f32c180083f323b616.tar.bz2
Teach packing about "tag" objects
(And teach sha1_file and unpack-object know how to unpack them too, of course)
Diffstat (limited to 'unpack-objects.c')
-rw-r--r--unpack-objects.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/unpack-objects.c b/unpack-objects.c
index a792b92..57f3c9b 100644
--- a/unpack-objects.c
+++ b/unpack-objects.c
@@ -124,6 +124,7 @@ static int unpack_non_delta_entry(struct pack_entry *entry,
case 'C': type_s = "commit"; break;
case 'T': type_s = "tree"; break;
case 'B': type_s = "blob"; break;
+ case 'G': type_s = "tag"; break;
default: goto err_finish;
}
if (write_sha1_file(buffer, size, type_s, sha1) < 0)
@@ -249,7 +250,7 @@ static void unpack_entry(struct pack_entry *entry)
size = (pack[1] << 24) + (pack[2] << 16) + (pack[3] << 8) + pack[4];
left = pack_size - offset - 5;
switch (*pack) {
- case 'C': case 'T': case 'B':
+ case 'C': case 'T': case 'B': case 'G':
unpack_non_delta_entry(entry, *pack, pack+5, size, left);
break;
case 'D':