diff options
author | Erich Eckner <git@eckner.net> | 2019-04-12 13:22:09 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-04-12 13:22:09 +0200 |
commit | 9f902ea9738f0049b94efbced75a560dc145ac1c (patch) | |
tree | 6bdd682c8055d7a1d8e26a5a006d5c80ca3ed475 /bin | |
parent | ceab9cd198f4b9c72df62b05db49c1ad9b98dea2 (diff) | |
download | builder-9f902ea9738f0049b94efbced75a560dc145ac1c.tar.xz |
bin/get-package-updates: check, that we do not go back in time
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/get-package-updates | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates index 1248fec..708b5ff 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -242,9 +242,16 @@ for repo in ${repo_names}; do git -C "${repo_path}" rev-parse HEAD )'" else - eval "new_repo_revisions__${repo}='$( + new_rev=$( git -C "${repo_path}" rev-list -n1 --until "${date_time}" HEAD - )'" + ) + eval 'old_rev="${old_repo_revisions__'"${repo}"'}"' + # do not go backwards in time + # shellcheck disable=SC2154 + if ! git -C "${repo_path}" merge-base --is-ancestor "${old_rev}" "${new_rev}"; then + new_rev="${old_rev}" + fi + eval "new_repo_revisions__${repo}='${new_rev}'" fi else eval 'new_repo_revisions__'"${repo}"'="${old_repo_revisions__'"${repo}"'}"' |