From 35039ced9296786bc0971bf5385c0d6f6ea5ea1e Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 27 Jul 2010 13:32:36 -0500 Subject: archive: abbreviate substituted commit ids again Given a file with: (define archive-id "$Format:%ct|%h|a$") and an export-subst attribute, the "%h" results in an full 40-digit object name instead of the expected 7-digit one. The export-subst feature requests unabbreviated object names because that is the low-level default. The effect was not observable until v1.7.1.1~17^2~3 (2010-05-03), which taught log --format=%h to respect the --abbrev option. Reported-by: Eli Barzilay Tested-by: Eli Barzilay Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- archive.c | 1 + 1 file changed, 1 insertion(+) (limited to 'archive.c') diff --git a/archive.c b/archive.c index d700af3b62..edd68534fa 100644 --- a/archive.c +++ b/archive.c @@ -33,6 +33,7 @@ static void format_subst(const struct commit *commit, struct strbuf fmt = STRBUF_INIT; struct pretty_print_context ctx = {0}; ctx.date_mode = DATE_NORMAL; + ctx.abbrev = DEFAULT_ABBREV; if (src == buf->buf) to_free = strbuf_detach(buf, NULL); -- cgit v1.2.3