summaryrefslogtreecommitdiff
path: root/bin/common-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-05-04 15:46:01 +0200
committerErich Eckner <git@eckner.net>2017-05-04 15:46:01 +0200
commiteb68b12a3baa065e68ce83dff57759a08f60cb9e (patch)
tree06ea64859ad1fe2c2417098fa48fb9004cee8761 /bin/common-functions
parentbc55a8b39392301dcb785c485dbc4f765d7e7e49 (diff)
downloadbuilder-eb68b12a3baa065e68ce83dff57759a08f60cb9e.tar.xz
bin/build-packages: clean up checkout
Diffstat (limited to 'bin/common-functions')
-rwxr-xr-xbin/common-functions11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/common-functions b/bin/common-functions
index 2191d01..7b5aa18 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -18,3 +18,14 @@ find_pkgbuild() {
sort | \
tail -n1
}
+
+find_repository_with_commit() {
+ for repository in "${!repo_paths[@]}"; do
+ if [ "$(git -C "${repo_paths["${repository}"]}" cat-file -t "$1")" == "commit" ]; then
+ echo "${repository}"
+ return 0
+ fi
+ done
+ >&2 echo "can't find repository with commit '$1'"
+ exit 1
+}