From 183f930a57364dbcfd63da4902accd8f8d0ec658 Mon Sep 17 00:00:00 2001 From: simonzack Date: Tue, 27 Jan 2015 16:38:43 +1100 Subject: [PATCH] allow empty emails --- lib/grit/actor.rb | 4 ++-- lib/grit/git-ruby/git_object.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/grit/actor.rb b/lib/grit/actor.rb index 6ff418fd..cd985ca6 100644 --- a/lib/grit/actor.rb +++ b/lib/grit/actor.rb @@ -17,8 +17,8 @@ def initialize(name, email) # Returns Git::Actor. def self.from_string(str) case str - when /<.+>/ - m, name, email = *str.match(/(.*) <(.+?)>/) + when /<.*>/ + m, name, email = *str.match(/(.*) <(.*?)>/) return self.new(name, email) else return self.new(str, nil) diff --git a/lib/grit/git-ruby/git_object.rb b/lib/grit/git-ruby/git_object.rb index aa743276..bc6142fc 100644 --- a/lib/grit/git-ruby/git_object.rb +++ b/lib/grit/git-ruby/git_object.rb @@ -28,8 +28,8 @@ def initialize(str) m = /^(.*?) <(.*)> (\d+) ([+-])0*(\d+?)$/.match(str) if !m case str - when /<.+>/ - m, @name, @email = *str.match(/(.*) <(.+?)>/) + when /<.*>/ + m, @name, @email = *str.match(/(.*) <(.*?)>/) else @name = str end