From 9f902ea9738f0049b94efbced75a560dc145ac1c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 12 Apr 2019 13:22:09 +0200 Subject: bin/get-package-updates: check, that we do not go back in time --- bin/get-package-updates | 11 +++++++++-- 1 file 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}"'}"' -- cgit v1.2.3-70-g09d2