From 0ce7d041f53bea47f98f509ccf7c196b8ad393b0 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 25 Mar 2014 15:24:55 -0400 Subject: [PATCH] Removed trailing whitespace. --- services/api/app/models/commit.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/api/app/models/commit.rb b/services/api/app/models/commit.rb index c371ac278b..0e9ae11705 100644 --- a/services/api/app/models/commit.rb +++ b/services/api/app/models/commit.rb @@ -4,7 +4,7 @@ class Commit < ActiveRecord::Base def self.find_commit_range(current_user, repository, minimum, maximum, exclude) # disallow starting with '-' so verision strings can't be interpreted as command line options valid_pattern = /[A-Za-z0-9_][A-Za-z0-9_-]/ - if (minimum and !minimum.match valid_pattern) || !maximum.match valid_pattern + if (minimum and !minimum.match valid_pattern) or !maximum.match valid_pattern logger.warn "find_commit_range called with string containing invalid characters: '#{minimum}', '#{maximum}'" return nil end @@ -12,7 +12,7 @@ class Commit < ActiveRecord::Base if minimum and minimum.empty? minimum = nil end - + if !maximum maximum = "HEAD" end @@ -65,7 +65,7 @@ class Commit < ActiveRecord::Base end end - if minimum + if minimum # Get the commit hash for the lower bound min_hash = nil IO.foreach("|git rev-list --max-count=1 #{minimum}") do |line| @@ -74,12 +74,12 @@ class Commit < ActiveRecord::Base # If not found or string is invalid, nothing else to do next if !min_hash or !min_hash.match valid_pattern - + # Now find all commits between them #puts "git rev-list #{min_hash}..#{max_hash}" IO.foreach("|git rev-list #{min_hash}..#{max_hash}") do |line| hash = line.strip - commits.push(hash) if !resolved_exclude or !resolved_exclude.include? hash + commits.push(hash) if !resolved_exclude or !resolved_exclude.include? hash end commits.push(min_hash) if !resolved_exclude or !resolved_exclude.include? min_hash -- 2.30.2