From 9aaa473e7d998b63b0319faa143cc3722f0f8664 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Mon, 1 Oct 2018 17:29:15 +0200 Subject: [PATCH] Add some dummy hash for uncommited Dockerfiles Signed-off-by: Tilo Spannagel --- generate-stackbrew-library.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 506eeda..564ecf5 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -11,7 +11,13 @@ cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" # Get the most recent commit which modified any of "$@". fileCommit() { - git log -1 --format='format:%H' HEAD -- "$@" + commit="$(git log -1 --format='format:%H' HEAD -- "$@")" + if [ -z "$commit" ]; then + # return some valid sha1 hash to make bashbrew happy + echo '0000000000000000000000000000000000000000' + else + echo "$commit" + fi } # Get the most recent commit which modified "$1/Dockerfile" or any file that