From f4204ab9f6a192cdb9a68150e031d7183688bfeb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 21 Nov 2006 23:36:35 -0800 Subject: Store peeled refs in packed-refs (take 2). This fixes the previous implementation which failed to optimize repositories with tons of lightweight tags. The updated packed-refs format begins with "# packed-refs with:" line that lists the kind of extended data the file records. Currently, there is only one such extension defined, "peeled". This stores the "peeled tag" on a line that immediately follows a line for a tag object itself in the format "^". The header line itself and any extended data are ignored by older implementation, so packed-refs file generated with this version can still be used by older git. packed-refs made by older git can of course be used with this version. Signed-off-by: Junio C Hamano --- builtin-show-ref.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'builtin-show-ref.c') diff --git a/builtin-show-ref.c b/builtin-show-ref.c index 9ae3d08546..073979855b 100644 --- a/builtin-show-ref.c +++ b/builtin-show-ref.c @@ -67,8 +67,10 @@ match: return 0; if ((flag & REF_ISPACKED) && !peel_ref(refname, peeled)) { - hex = find_unique_abbrev(peeled, abbrev); - printf("%s %s^{}\n", hex, refname); + if (!is_null_sha1(peeled)) { + hex = find_unique_abbrev(peeled, abbrev); + printf("%s %s^{}\n", hex, refname); + } } else { obj = parse_object(sha1); -- cgit v1.2.3