forked from toolshed/abra
test: use more plumbung for git output
This commit is contained in:
@ -37,14 +37,6 @@ _set_git_author() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
_latest_tag() {
|
||||
export LATEST_TAG=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" describe --abbrev=0)
|
||||
}
|
||||
|
||||
_latest_hash() {
|
||||
export LATEST_HASH=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" log -1 --pretty=format:%h)
|
||||
}
|
||||
|
||||
_git_commit() {
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" add .
|
||||
assert_success
|
||||
@ -52,3 +44,23 @@ _git_commit() {
|
||||
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" commit -m "test: helpers/git.bash: _git_commit"
|
||||
assert_success
|
||||
}
|
||||
|
||||
_get_tag_hash() {
|
||||
tagHash=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" rev-list -n 1 "$1")
|
||||
assert_success
|
||||
}
|
||||
|
||||
_get_head_hash() {
|
||||
headHash=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" show -s --format="%H" HEAD)
|
||||
assert_success
|
||||
}
|
||||
|
||||
_get_current_hash() {
|
||||
currentHash=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" show -s --format="%H")
|
||||
assert_success
|
||||
}
|
||||
|
||||
_get_n_hash() {
|
||||
nHash=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" show -s --format="%H" "HEAD~$1")
|
||||
assert_success
|
||||
}
|
||||
|
Reference in New Issue
Block a user