Skip to content

Commit

Permalink
Merge pull request git-commit-notifier#195 from kovalevsky/master
Browse files Browse the repository at this point in the history
The regular expression adjusted to include the underscore in repo name.
  • Loading branch information
akzhan committed Aug 29, 2013
2 parents 7474c26 + 9498ac1 commit 5c498b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/git_commit_notifier/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def short_commit_id(param)
def branch_head(treeish)
from_shell("git rev-parse #{treeish}").strip
end


# Lists commits between specified rev and closest annotated tag.
# Uses `git describe` to obtain information.
Expand All @@ -142,7 +142,7 @@ def branch_head(treeish)
# Looking forward to someone coming up with a better way.
def list_of_commits_between_current_commit_and_last_tag(tag_name, rev)
result = Array.new

lines = from_shell("git describe --abbrev=0 #{rev}^1 2> /dev/null | cat ").strip # the `cat` is used to suppress the error that might arise when handling the case of the first commit
if lines.length != 1
previous_tag = lines
Expand Down Expand Up @@ -252,7 +252,7 @@ def repo_name_with_parent
if git_path.empty?
git_path = git_dir
end
name_with_parent = File.expand_path(git_path).scan(/[a-zA-z0-9\-]+\/[a-zA-Z0-9\-]+.git$/).first;
name_with_parent = File.expand_path(git_path).scan(/[a-zA-z0-9\-_]+\/[a-zA-Z0-9\-_]+.git$/).first;
return name_with_parent.sub(/\.git$/, '') unless name_with_parent.empty?
File.expand_path(git_path).split("/").last.sub(/\.git$/, '')
end
Expand Down

0 comments on commit 5c498b3

Please sign in to comment.