You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/03/30 21:30:35 UTC

[10/17] allura git commit: [#7837] ticket:736 Fix filenames with whitespaces and/or unicode

[#7837] ticket:736 Fix filenames with whitespaces and/or unicode


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/96ac7a67
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/96ac7a67
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/96ac7a67

Branch: refs/heads/master
Commit: 96ac7a67c201e99f0571f908d58a6312ca8d9571
Parents: 2ae15ff
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Mar 3 10:06:55 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Mar 30 19:20:41 2015 +0000

----------------------------------------------------------------------
 ForgeGit/forgegit/model/git_repo.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/96ac7a67/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index ab0189e..3b3b9e9 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -610,11 +610,14 @@ class GitImplementation(M.RepositoryImplementation):
             # show tree entry itself as well as subtrees (Commit.added_paths
             # relies on this)
             '-t',
+            '-z',  # don't escape filenames and use \x00 as fields delimiter
             commit_id)
-        files = files.splitlines()
-        total = len(files)
-        for f in files[start:end]:
-            status, name = f.split('\t', 1)
+        files = files.split('\x00')[:-1]
+        # files = ['A', 'filename', 'D', 'another filename', ...]
+        total = len(files) / 2
+        for i in range(1, len(files), 2):
+            status = files[i-1]
+            name = h.really_unicode(files[i])
             if status == 'A':
                 added.append(name)
             elif status == 'D':