Skip to content

Commit 9083f97

Browse files
committed
Show full branch name (standard case when branch name looks like feature/use-jquery-1.6.3)
1 parent 5c8289a commit 9083f97

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/git_commit_notifier/commit_hook.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ def run(config_name, rev1, rev2, ref_name)
6363
logger.debug("included branches: #{include_branches.join(', ')}") unless include_branches.nil?
6464

6565
prefix = config["emailprefix"] || Git.repo_name
66-
branch_name = ref_name.split("/").last
66+
branch_name = if ref_name =~ /^refs\/heads\/(.+)$/
67+
$1
68+
else
69+
ref_name.split("/").last
70+
end
6771

6872
logger.debug("prefix: #{prefix}")
6973
logger.debug("branch: #{branch_name}")
@@ -74,7 +78,7 @@ def run(config_name, rev1, rev2, ref_name)
7478
end
7579

7680
branch_name = "/#{branch_name}"
77-
branch_name = "" if !config["show_master_branch_name"] && branch_name.eql?('/master')
81+
branch_name = "" if !config["show_master_branch_name"] && branch_name == '/master'
7882

7983
info("Sending mail...")
8084

0 commit comments

Comments
 (0)