diff --git a/functions.sh b/functions.sh index 6015704d58..cb52bf816c 100644 --- a/functions.sh +++ b/functions.sh @@ -51,8 +51,8 @@ docker_try_rmi() { } sonic_get_version() { - local describe=$(git describe --tags) - local latest_tag=$(git describe --tags --abbrev=0) + local describe=$(git describe --tags 2>/dev/null) + local latest_tag=$(git describe --tags --abbrev=0 2>/dev/null) local branch_name=$(git rev-parse --abbrev-ref HEAD) if [ -n "$(git status --untracked-files=no -s --ignore-submodules)" ]; then local dirty="-dirty-$BUILD_TIMESTAMP"