diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-02 11:52:33 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-02 11:52:33 -0300 |
commit | 0b0ef57e812fe0484b9a85d61f0df290ba06280e (patch) | |
tree | 54b2d6b6047feea959eec5520821dbd46011c189 /tools/build_snapshots.sh | |
parent | a59ea5eed1b7c5e4c12c6abb524082dbdac2c47f (diff) | |
download | pfsense-0b0ef57e812fe0484b9a85d61f0df290ba06280e.zip pfsense-0b0ef57e812fe0484b9a85d61f0df290ba06280e.tar.gz |
Deduplicate git_last_commit()
Diffstat (limited to 'tools/build_snapshots.sh')
-rwxr-xr-x | tools/build_snapshots.sh | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/build_snapshots.sh b/tools/build_snapshots.sh index fc16794..1791b68 100755 --- a/tools/build_snapshots.sh +++ b/tools/build_snapshots.sh @@ -92,13 +92,6 @@ mkdir -p $STAGINGAREA echo "" > $SNAPSHOTSLOGFILE echo "" > $SNAPSHOTSLASTUPDATE -git_last_commit() { - if [ -d "${1}/.git" ]; then - git -C "${1}" pull -q - git -C "${1}" log -1 --format='%H' - fi -} - # This routine is called in between runs. We # will sleep for a bit and check for new commits # in between sleeping for short durations. @@ -106,7 +99,9 @@ sleep_between_runs() { COUNTER=0 while [ $COUNTER -lt $maxsleepvalue ]; do sleep 60 - CURRENT_COMMIT=$(git_last_commit "${BUILDER_ROOT}") + # Update this repo + git -C "${BUILDER_ROOT}" pull -q + git_last_commit if [ "${LAST_COMMIT}" != "${CURRENT_COMMIT}" ]; then update_status ">>> New commit: $CURRENT_AUTHOR - $CURRENT_COMMIT .. No longer sleepy." COUNTER=$(($maxsleepvalue + 60)) |