From 0734756ee41d97842081c24d1650dfdd75697b45 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 20 Jun 2015 14:34:32 +0200 Subject: [PATCH 1/2] Convert CRLF newlines to LF when committing using the web editor. --- CHANGELOG | 1 + app/models/repository.rb | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d1bf4c1fb0f..5e2fee110cf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ v 7.13.0 (unreleased) - Rename "Design" profile settings page to "Preferences". - Allow users to customize their default Dashboard page. - Update ssl_ciphers in Nginx example to remove DHE settings. This will deny forward secrecy for Android 2.3.7, Java 6 and OpenSSL 0.9.8 + - Convert CRLF newlines to LF when committing using the web editor. v 7.12.0 (unreleased) - Fix Error 500 when one user attempts to access a personal, internal snippet (Stan Hu) diff --git a/app/models/repository.rb b/app/models/repository.rb index 2c6347222aa..b32e8847bb5 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -5,8 +5,13 @@ class Repository def initialize(path_with_namespace, default_branch = nil, project = nil) @path_with_namespace = path_with_namespace - @raw_repository = Gitlab::Git::Repository.new(path_to_repo) if path_with_namespace @project = project + + if path_with_namespace + @raw_repository = Gitlab::Git::Repository.new(path_to_repo) + @raw_repository.autocrlf = :input + end + rescue Gitlab::Git::Repository::NoRepository nil end From cfc261d7078347d83e865e48efe948158aac0622 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 22 Jun 2015 11:24:02 +0200 Subject: [PATCH 2/2] Bump gitlab_git to 7.2.5 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index a4a4ba74e69..4f01d13a127 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ gem "browser", '~> 0.8.0' # Extracting information from a git repository # Provide access to Gitlab::Git library -gem "gitlab_git", '~> 7.2.3' +gem "gitlab_git", '~> 7.2.5' # Ruby/Rack Git Smart-HTTP Server Handler # GitLab fork with a lot of changes (improved thread-safety, better memory usage etc) diff --git a/Gemfile.lock b/Gemfile.lock index 0640c14d343..e64a32b6230 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -266,7 +266,7 @@ GEM mime-types (~> 1.19) gitlab_emoji (0.1.0) gemojione (~> 2.0) - gitlab_git (7.2.3) + gitlab_git (7.2.5) activesupport (~> 4.0) charlock_holmes (~> 0.6) gitlab-linguist (~> 3.0) @@ -765,7 +765,7 @@ DEPENDENCIES gitlab-grack (~> 2.0.2) gitlab-linguist (~> 3.0.1) gitlab_emoji (~> 0.1) - gitlab_git (~> 7.2.3) + gitlab_git (~> 7.2.5) gitlab_meta (= 7.0) gitlab_omniauth-ldap (= 1.2.1) gollum-lib (~> 4.0.2)