diff --git a/tools/packaging/scripts/lib.sh b/tools/packaging/scripts/lib.sh index c42534108..aa101b870 100644 --- a/tools/packaging/scripts/lib.sh +++ b/tools/packaging/scripts/lib.sh @@ -106,6 +106,7 @@ get_kata_hash() { get_last_modification() { local file="${1}" + pushd ${repo_root_dir} &> /dev/null # This is a workaround needed for when running this code on Jenkins git config --global --add safe.directory ${repo_root_dir} &> /dev/null @@ -113,6 +114,7 @@ get_last_modification() { [ $(git status --porcelain | grep "${file#${repo_root_dir}/}" | wc -l) -gt 0 ] && dirty="-dirty" echo "$(git log -1 --pretty=format:"%H" ${file})${dirty}" + popd &> /dev/null } # $1 - The tag to be pushed to the registry