From eb68b12a3baa065e68ce83dff57759a08f60cb9e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 4 May 2017 15:46:01 +0200 Subject: bin/build-packages: clean up checkout --- bin/common-functions | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bin/common-functions') 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 +} -- cgit v1.2.3-54-g00ecf