summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-07-05 09:20:22 +0000
committerRémy Coutable <remy@rymai.me>2017-07-05 09:20:22 +0000
commit5cd218d73ad099cd92100f3faf720b1cb155c396 (patch)
treeb439e2c2e1052d1b3e19507ef53c3cb0f9352e2f
parentdddfa49db6b592b79f562bca5bcd0f10280ae331 (diff)
parent82614f8675bd4cdcc9500f7550e4f6a0598904fb (diff)
downloadgitlab-ce-5cd218d73ad099cd92100f3faf720b1cb155c396.tar.gz
Merge branch 'dm-encode-tree-and-blob-paths' into 'master'
Fix issues with non-UTF8 filenames by always fixing the encoding of tree and blob paths Closes #34529 See merge request !12636
-rw-r--r--changelogs/unreleased/dm-encode-tree-and-blob-paths.yml5
-rw-r--r--lib/gitlab/git/blob.rb4
-rw-r--r--lib/gitlab/git/tree.rb4
3 files changed, 13 insertions, 0 deletions
diff --git a/changelogs/unreleased/dm-encode-tree-and-blob-paths.yml b/changelogs/unreleased/dm-encode-tree-and-blob-paths.yml
new file mode 100644
index 00000000000..c1a026e1f29
--- /dev/null
+++ b/changelogs/unreleased/dm-encode-tree-and-blob-paths.yml
@@ -0,0 +1,5 @@
+---
+title: Fix issues with non-UTF8 filenames by always fixing the encoding of tree and
+ blob paths
+merge_request:
+author:
diff --git a/lib/gitlab/git/blob.rb b/lib/gitlab/git/blob.rb
index a7aceab4c14..ffe4f3ca95f 100644
--- a/lib/gitlab/git/blob.rb
+++ b/lib/gitlab/git/blob.rb
@@ -175,6 +175,10 @@ module Gitlab
encode! @name
end
+ def path
+ encode! @path
+ end
+
def truncated?
size && (size > loaded_size)
end
diff --git a/lib/gitlab/git/tree.rb b/lib/gitlab/git/tree.rb
index b9afa05c819..b6d4e6cfe46 100644
--- a/lib/gitlab/git/tree.rb
+++ b/lib/gitlab/git/tree.rb
@@ -80,6 +80,10 @@ module Gitlab
encode! @name
end
+ def path
+ encode! @path
+ end
+
def dir?
type == :tree
end