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

[35/45] 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/1b698b20
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1b698b20
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1b698b20

Branch: refs/heads/ib/7837
Commit: 1b698b20a0a988ec4f0b730bb7421104397295a8
Parents: 97a9333
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Mar 3 10:06:55 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Fri Mar 27 15:09:25 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/1b698b20/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':