From 3c15749bd07a5ebd92ece505bb6b24f698c36fe2 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 23 Jul 2013 07:17:37 +0000 Subject: abuild: microoptimization. call git describe only once Use a global var for last_commit so we dont need call git for every subpackage --- abuild.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/abuild.in b/abuild.in index ea0ad02..e6969fa 100755 --- a/abuild.in +++ b/abuild.in @@ -808,10 +808,11 @@ EOF done fi - local last_commit="$(git_last_commit)$(git_dirty)" - if [ -n "$last_commit" ]; then - echo "commit = $last_commit" >> "$pkginfo" + # store last_commit in global var so we only call git once + if [ -z "$last_commit" ]; then + last_commit="$(git_last_commit)$(git_dirty)" fi + echo "commit = $last_commit" >> "$pkginfo" get_maintainer if [ -n "$maintainer" ]; then -- cgit v1.2.3-70-g09d2