diff --git a/scripts/image b/scripts/image index 92aa2c2ebd..ef6a20db62 100755 --- a/scripts/image +++ b/scripts/image @@ -31,7 +31,10 @@ $SCRIPTS/build kmod:host BUILD_DATE=`date +%Y%m%d%H%M%S` if [ "$OPENELEC_VERSION" = devel -o "$OPENELEC_VERSION" = debug ]; then - GIT_BUILD=$(git rev-list --count HEAD) + if ! GIT_BUILD=$(git rev-list --count HEAD 2>/dev/null) + then + GIT_BUILD=$(git rev-list HEAD | wc -l) + fi GIT_HASH=$(git rev-parse HEAD) GIT_ABBREV=$(git log -1 --pretty=format:%h) OPENELEC_VERSION=$OPENELEC_VERSION-$BUILD_DATE-r$GIT_BUILD-g$GIT_ABBREV