summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-06-20 14:34:32 +0200
committerDouwe Maan <douwe@gitlab.com>2015-06-20 14:35:24 +0200
commit0734756ee41d97842081c24d1650dfdd75697b45 (patch)
tree7851873b7a47f8ad11e1f5572dc039ac66a22d7a
parent07956981623d6c5a789fc78c8840079b5b73a5b1 (diff)
downloadgitlab-ce-web-editor-autocrlf.tar.gz
Convert CRLF newlines to LF when committing using the web editor.web-editor-autocrlf
-rw-r--r--CHANGELOG1
-rw-r--r--app/models/repository.rb7
2 files changed, 7 insertions, 1 deletions
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