Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-package-updates
diff options
context:
space:
mode:
Diffstat (limited to 'bin/get-package-updates')
-rwxr-xr-xbin/get-package-updates11
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}"'}"'