Skip to content

Commit b75d2ac

Browse files
author
Thomas Osowski
committed
Return if not processing a push to a branch
1 parent cea6782 commit b75d2ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hooks/ruby/dismiss-review-server/server.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020

2121
# Get branch information
2222
branch_name = parsed['ref']
23-
branch_name.slice!("refs/heads/")
23+
removed_slice = branch_name.slice!("refs/heads/")
24+
if removed_slice.nil?
25+
return "Not a branch. Nothing to do."
26+
end
2427

2528
# Get Repository owner
2629
repo_owner = parsed["repository"]["owner"]["name"]

0 commit comments

Comments
 (0)