summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 620bb24)
raw | patch | inline | side by side (parent: 620bb24)
author | Mike Hommey <mh@glandium.org> | |
Sat, 3 Nov 2007 13:08:05 +0000 (14:08 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 8 Nov 2007 01:25:47 +0000 (17:25 -0800) |
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-tag.c | patch | blob | history |
diff --git a/builtin-tag.c b/builtin-tag.c
index 66e5a5830792471a44c9211d4eafcf2b1ff6f0dd..4aca3dc79b2a3d28f158ff61c01363244bfd7637 100644 (file)
--- a/builtin-tag.c
+++ b/builtin-tag.c
}
printf("%-15s ", refname);
- sp = buf = read_sha1_file(sha1, &type, &size);
- if (!buf)
+ buf = read_sha1_file(sha1, &type, &size);
+ if (!buf || !size)
return 0;
- if (!size) {
+
+ /* skip header */
+ sp = strstr(buf, "\n\n");
+ if (!sp) {
free(buf);
return 0;
}
- /* skip header */
- while (sp + 1 < buf + size &&
- !(sp[0] == '\n' && sp[1] == '\n'))
- sp++;
/* only take up to "lines" lines, and strip the signature */
for (i = 0, sp += 2;
i < filter->lines && sp < buf + size &&