abuild: make sure to not get colors in git_last_commit

git log may return color codes if users colored output forcibly enabled
with:

[color]
	ui = always

Use `git rev-list` instead of `git log` to make sure that we don't get
any color codes.

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10042
This commit is contained in:
Natanael Copa 2021-10-07 13:06:06 +02:00
parent 3d9918f14d
commit 1c00caaddb
1 changed files with 1 additions and 1 deletions

View File

@ -951,7 +951,7 @@ git_dirty() {
# echo last commit hash id
git_last_commit() {
$git log --format=oneline -n 1 -- "$startdir" | awk '{print $1}'
$git rev-list -n 1 HEAD -- "$startdir"
}
# date of last commit