Merge branch 'ak/pretty-decorate-more-fix'
Unlike "git log --pretty=%D", "git log --pretty="%(decorate)" did not auto-initialize the decoration subsystem, which has been corrected. * ak/pretty-decorate-more-fix: pretty: fix ref filtering for %(decorate) formats
This commit is contained in:
4
pretty.c
4
pretty.c
@ -1961,6 +1961,10 @@ void userformat_find_requirements(const char *fmt, struct userformat_want *w)
|
|||||||
case 'D':
|
case 'D':
|
||||||
w->decorate = 1;
|
w->decorate = 1;
|
||||||
break;
|
break;
|
||||||
|
case '(':
|
||||||
|
if (starts_with(fmt + 1, "decorate"))
|
||||||
|
w->decorate = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -590,9 +590,9 @@ test_expect_success 'pretty format %decorate' '
|
|||||||
git log --format="%(decorate:prefix=,suffix=)" -1 >actual2 &&
|
git log --format="%(decorate:prefix=,suffix=)" -1 >actual2 &&
|
||||||
test_cmp expect2 actual2 &&
|
test_cmp expect2 actual2 &&
|
||||||
|
|
||||||
echo "[ HEAD -> foo; tag: bar; qux ]" >expect3 &&
|
echo "[ bar; qux; foo ]" >expect3 &&
|
||||||
git log --format="%(decorate:prefix=[ ,suffix= ],separator=%x3B )" \
|
git log --format="%(decorate:prefix=[ ,suffix= ],separator=%x3B ,tag=)" \
|
||||||
-1 >actual3 &&
|
--decorate-refs=refs/ -1 >actual3 &&
|
||||||
test_cmp expect3 actual3 &&
|
test_cmp expect3 actual3 &&
|
||||||
|
|
||||||
# Try with a typo (in "separator"), in which case the placeholder should
|
# Try with a typo (in "separator"), in which case the placeholder should
|
||||||
|
Reference in New Issue
Block a user