diff --git a/CHANGELOG b/CHANGELOG index 63b04cc5b36649d93a7e0f4d743cfeafe3e7e16a..a15aefdff8f5edfa8ec36707464efb78a4d15fa1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ v3.0.0 + - Remove extraneous newlines in pre-receive hook - Remove rm-tag command (Robert Schilling) - Remove create-branch and rm-branch commands (Robert Schilling) - Update PostReceive worker so it logs a unique JID in Sidekiq diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb index 5816969181e192afff54ea218b6650b05dcd0150..bb6bc58756010c668546c43b2cd983a88bcd8fae 100644 --- a/lib/gitlab_access.rb +++ b/lib/gitlab_access.rb @@ -16,7 +16,7 @@ class GitlabAccess @repo_path = repo_path.strip @actor = actor @repo_name = extract_repo_name(@repo_path.dup, config.repos_path.to_s) - @changes = changes.lines + @changes = changes.split("\n") end def exec diff --git a/spec/gitlab_access_spec.rb b/spec/gitlab_access_spec.rb index 4768c7150ba54991354c87ec8d8499b2444e063a..58f654d3f2e98c590db9bc55f456dc19bcd332b4 100644 --- a/spec/gitlab_access_spec.rb +++ b/spec/gitlab_access_spec.rb @@ -11,7 +11,7 @@ describe GitlabAccess do end end subject do - GitlabAccess.new(repo_path, 'key-123', 'wow').tap do |access| + GitlabAccess.new(repo_path, 'key-123', "first\nsecond\n").tap do |access| access.stub(exec_cmd: :exec_called) access.stub(api: api) end @@ -24,7 +24,7 @@ describe GitlabAccess do describe :initialize do it { subject.repo_name.should == repo_name } it { subject.repo_path.should == repo_path } - it { subject.changes.should == ['wow'] } + it { subject.changes.should == ['first', 'second'] } end describe "#exec" do