test: return/echo from git helper functions

This commit is contained in:
2024-06-22 17:02:15 +02:00
parent aa3910f8df
commit 9ec99c7712
2 changed files with 11 additions and 14 deletions

View File

@ -48,19 +48,23 @@ _git_commit() {
_get_tag_hash() {
tagHash=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" rev-list -n 1 "$1")
assert_success
echo "$tagHash"
}
_get_head_hash() {
headHash=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" show -s --format="%H" HEAD)
assert_success
echo "$headHash"
}
_get_current_hash() {
currentHash=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" show -s --format="%H")
assert_success
echo "$currentHash"
}
_get_n_hash() {
nHash=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" show -s --format="%H" "HEAD~$1")
assert_success
echo "$nHash"
}