diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-04-12 14:03:16 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-04-12 14:05:34 +0000 |
commit | d7820ae0adb7dd729e4e27a6355ef9c1b7fac69c (patch) | |
tree | 641671e8b64bd25ef352a73afbefa7767f96bfd6 /tcwg-report-stale-rr-jobs.sh | |
parent | 4b3f91861b3647b62436e07447fff0a46cf797c6 (diff) |
tcwg-report-stale-rr-jobs.sh: Cache fetched refs
... to speedup subsequent fetches.
Change-Id: Ic1ab5c90ce2b4e4627e3add064531b2790ee594a
Diffstat (limited to 'tcwg-report-stale-rr-jobs.sh')
-rwxr-xr-x | tcwg-report-stale-rr-jobs.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tcwg-report-stale-rr-jobs.sh b/tcwg-report-stale-rr-jobs.sh index 2e440d0b..d0e48bd8 100755 --- a/tcwg-report-stale-rr-jobs.sh +++ b/tcwg-report-stale-rr-jobs.sh @@ -38,8 +38,9 @@ process_git_url () # Walk through all commits of all tcwg_bmk* branches and mark results # referenced in those results with "used_by" file. while IFS= read -r ref; do - git -C "$refs_repo" fetch -q origin "$ref" >/dev/null 2>&1 - commit_stamp=$(git -C "$refs_repo" show --no-patch --pretty=%ct FETCH_HEAD) + dst_ref="refs/remotes/origin/${ref#refs/heads/}" + git -C "$refs_repo" fetch -q origin "+$ref:$dst_ref" >/dev/null 2>&1 + commit_stamp=$(git -C "$refs_repo" show --no-patch --pretty=%ct "$dst_ref") days_ago=$((($(date +%s) - $commit_stamp) / (24 * 3600))) if [ $days_ago -gt $days ]; then if $human; then |