Skip to content

Commit 930fa58

Browse files
committed
Specify bash
1 parent 9c14147 commit 930fa58

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pre-commit-hooks/verify-commits.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
#!/bin/sh
2-
1+
#!/bin/bash
32

43
# git for-each-ref refs/tags # see which tags are annotated and which are lightweight. Annotated tags are "tag" objects.
54
# # Set these so your commits and tags are always signed
65
# git config commit.gpgsign true
76
# git config tag.gpgsign true
87

98
verify_commit_signed() {
10-
if git verify-commit HEAD &> /dev/null; then
9+
if git verify-commit HEAD &>/dev/null; then
1110
:
1211
# echo "HEAD commit seems signed..."
1312
else
@@ -17,7 +16,7 @@ verify_commit_signed() {
1716
}
1817

1918
verify_tag() {
20-
if git describe --exact-match --tags HEAD &> /dev/null; then
19+
if git describe --exact-match --tags HEAD &>/dev/null; then
2120
: # You might be ok to push
2221
# echo "Tag is annotated."
2322
return 0
@@ -28,7 +27,7 @@ verify_tag() {
2827
}
2928

3029
verify_tag_signed() {
31-
if git verify-tag "$version" &> /dev/null ; then
30+
if git verify-tag "$version" &>/dev/null; then
3231
: # ok, I guess we'll let you push
3332
# echo "Tag appears signed"
3433
return 0
@@ -40,11 +39,11 @@ verify_tag_signed() {
4039
}
4140

4241
# Check some things if we're pushing a branch called "release/"
43-
if echo "$PRE_COMMIT_REMOTE_BRANCH" | grep ^refs\/heads\/release\/ &> /dev/null ; then
42+
if echo "$PRE_COMMIT_REMOTE_BRANCH" | grep ^refs\/heads\/release\/ &>/dev/null; then
4443
version=$(git tag --points-at HEAD)
4544
echo "Looks like you're trying to push a $version release..."
4645
echo "Making sure you've signed and tagged it."
47-
if verify_commit_signed && verify_tag && verify_tag_signed ; then
46+
if verify_commit_signed && verify_tag && verify_tag_signed; then
4847
: # Ok, I guess you can push
4948
else
5049
exit 1

0 commit comments

Comments
 (0)