diff options
-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}"'}"' |