Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ EOF

publishedGitVersion=$(cat oci/blobs/sha256/$manifest | jq -r '.annotations."com.cisco.stacker.git_version"')
# ci does not clone tags. There it tests the fallback-to-commit path.
myGitVersion=$(git describe --tags) || myGitVersion=$(git rev-parse HEAD)
[ -n "$(git status --porcelain --untracked-files=no)" ] &&
myGitVersion=$(run_git describe --tags) || myGitVersion=$(run_git rev-parse HEAD)
[ -n "$(run_git status --porcelain --untracked-files=no)" ] &&
dirty="-dirty" || dirty=""
[ "$publishedGitVersion" = "$myGitVersion$dirty" ]

Expand Down
6 changes: 5 additions & 1 deletion test/helpers.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
ROOT_DIR=$(git rev-parse --show-toplevel)
function run_git {
sudo -u $SUDO_USER git "$@"
}

ROOT_DIR=$(run_git rev-parse --show-toplevel)
if [ "$(id -u)" != "0" ]; then
echo "you should be root to run this suite"
exit 1
Expand Down