@@ -455,11 +455,16 @@ void normalize_glob_ref(struct string_list_item *item, const char *prefix,
if (*pattern == '/')
BUG("pattern must not start with '/'");
- if (prefix) {
+ if (prefix)
strbuf_addstr(&normalized_pattern, prefix);
- }
- else if (!starts_with(pattern, "refs/"))
+ else if (!starts_with(pattern, "refs/") &&
+ strcmp(pattern, "HEAD"))
strbuf_addstr(&normalized_pattern, "refs/");
+ /*
+ * NEEDSWORK: Special case other symrefs such as REBASE_HEAD,
+ * MERGE_HEAD, etc.
+ */
+
strbuf_addstr(&normalized_pattern, pattern);
strbuf_strip_suffix(&normalized_pattern, "/");
@@ -1025,6 +1025,12 @@ test_expect_success 'decorate-refs and simplify-by-decoration without output' '
test_cmp expect actual
'
+test_expect_success 'decorate-refs-exclude HEAD' '
+ git log --decorate=full --oneline \
+ --decorate-refs-exclude="HEAD" >actual &&
+ ! grep HEAD actual
+'
+
test_expect_success 'log.decorate config parsing' '
git log --oneline --decorate=full >expect.full &&
git log --oneline --decorate=short >expect.short &&