From 1c00caaddb73b2177d49bcb126a44a9b7b73d099 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 7 Oct 2021 13:06:06 +0200 Subject: [PATCH] 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 --- abuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abuild.in b/abuild.in index 52e7563..a312fbf 100644 --- a/abuild.in +++ b/abuild.in @@ -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