Skip to content

Commit 80191e1

Browse files
committed
Make the script executable from different folder
1 parent 04b8205 commit 80191e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

verify_commit_messages_in_branch.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
# If there is no difference then the latest commit will be used.
55
set -eu
66

7-
commits_since_master=$(git rev-list HEAD ^origin/master)
7+
script_dir=$(dirname "$0")
8+
commits_since_master=$(git -C $script_dir rev-list HEAD ^origin/master)
89

910
while read -r commit_hash; do
10-
commit_message="$(git log --format=%B -n 1 $commit_hash)"
11-
python3 bad_commit_message_blocker.py --message "$commit_message"
11+
commit_message="$(git -C $script_dir log --format=%B -n 1 $commit_hash)"
12+
python3 $script_dir/bad_commit_message_blocker.py --message "$commit_message"
1213
done <<< "$commits_since_master"

0 commit comments

Comments
 (0)