Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-05-22 00:17:41 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-05-22 00:17:41 +0400
commit1b2068eaa91e5002d01a220c65da21dad8ccb071 (patch)
treefcfeafc2d1ad23aa3b5ae4e8d19b76c3cd2efcdc
parent09831488c9be082f424c774e8eecd3f002dbae37 (diff)
Gem updates & githost logger
* Grit gem updated * gitolite-client updated * logger added * few fixes
-rw-r--r--Gemfile4
-rw-r--r--Gemfile.lock12
-rw-r--r--app/controllers/commits_controller.rb1
-rw-r--r--app/helpers/application_helper.rb1
-rw-r--r--app/models/commit.rb2
-rw-r--r--lib/gitlabhq/encode.rb2
-rw-r--r--lib/gitlabhq/gitolite.rb1
-rw-r--r--lib/gitlabhq/logger.rb8
8 files changed, 23 insertions, 8 deletions
diff --git a/Gemfile b/Gemfile
index d8dbd0f6e34..5cfcca2fa2a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -11,8 +11,8 @@ gem "kaminari"
gem "haml", "3.1.4"
gem "haml-rails"
gem "jquery-rails"
-gem "grit", :git => "https://github.com/gitlabhq/grit.git"
-gem "gitolite", :git => "https://github.com/gitlabhq/gitolite-client.git"
+gem "grit", :git => "https://github.com/gitlabhq/grit.git", :ref => "810e3c11787e9d84c5925a7edc3264db0f04bb49"
+gem "gitolite", :git => "https://github.com/gitlabhq/gitolite-client.git", :ref => "9b715ca8bab6529f6c92204a25f84d12f25a6eb0"
gem "carrierwave"
gem "six"
gem "therubyracer"
diff --git a/Gemfile.lock b/Gemfile.lock
index 7bcd3b7a687..d3c07f662e2 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -6,17 +6,19 @@ GIT
GIT
remote: https://github.com/gitlabhq/gitolite-client.git
- revision: 36dabd226caa40ff052677719adaacbfe667b36c
+ revision: 9b715ca8bab6529f6c92204a25f84d12f25a6eb0
+ ref: 9b715ca8bab6529f6c92204a25f84d12f25a6eb0
specs:
- gitolite (0.0.3.alpha)
- grit (~> 2.4.1)
+ gitolite (0.0.4.alpha)
+ grit (>= 2.4.1)
hashery (~> 1.4.0)
GIT
remote: https://github.com/gitlabhq/grit.git
- revision: 3fc864f3c637e06e2fa7a81f6b48a5df58a9bc5b
+ revision: 810e3c11787e9d84c5925a7edc3264db0f04bb49
+ ref: 810e3c11787e9d84c5925a7edc3264db0f04bb49
specs:
- grit (2.4.1)
+ grit (2.5.0)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
posix-spawn (~> 0.3.6)
diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb
index 9a97e5c6282..8a91c28480c 100644
--- a/app/controllers/commits_controller.rb
+++ b/app/controllers/commits_controller.rb
@@ -15,6 +15,7 @@ class CommitsController < ApplicationController
def index
@repo = project.repo
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
+
@commits = @project.commits(@ref, params[:path], @limit, @offset)
respond_to do |format|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 587e6e7da5a..7cbc6c4f41c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2,6 +2,7 @@ require 'digest/md5'
module ApplicationHelper
def gravatar_icon(user_email = '', size = 40)
+ return unless user_email
gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com"
user_email.strip!
"#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon"
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 574f69bc213..ad6d7127e76 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -73,7 +73,7 @@ class Commit
repo.commits(ref, limit, offset)
else
repo.commits(ref)
- end.map{ |c| Commit.new(c) }
+ end.map{ |c| Commit.new(c) }
end
def commits_between(repo, from, to)
diff --git a/lib/gitlabhq/encode.rb b/lib/gitlabhq/encode.rb
index 11d9bd7bfd9..55e86192ad4 100644
--- a/lib/gitlabhq/encode.rb
+++ b/lib/gitlabhq/encode.rb
@@ -3,6 +3,8 @@ module Gitlabhq
extend self
def utf8 message
+ return nil unless message
+
hash = CharlockHolmes::EncodingDetector.detect(message) rescue {}
if hash[:encoding]
CharlockHolmes::Converter.convert(message, hash[:encoding], 'UTF-8')
diff --git a/lib/gitlabhq/gitolite.rb b/lib/gitlabhq/gitolite.rb
index fabeb7d0fca..48c67082b22 100644
--- a/lib/gitlabhq/gitolite.rb
+++ b/lib/gitlabhq/gitolite.rb
@@ -46,6 +46,7 @@ module Gitlabhq
end
end
rescue Exception => ex
+ Gitlabhq::Logger.error(ex.message)
raise Gitolite::AccessDenied.new("gitolite timeout")
end
diff --git a/lib/gitlabhq/logger.rb b/lib/gitlabhq/logger.rb
new file mode 100644
index 00000000000..08b4bde0b0c
--- /dev/null
+++ b/lib/gitlabhq/logger.rb
@@ -0,0 +1,8 @@
+module Gitlabhq
+ class Logger
+ def self.error(message)
+ @@logger ||= ::Logger.new(File.join(Rails.root, "log/githost.log"))
+ @@logger.error(message)
+ end
+ end
+end