allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject [1/2] allura git commit: Ensure the log output always has one line of non-files so split works right
Date Tue, 24 Oct 2017 18:45:21 GMT
Repository: allura
Updated Branches:
  refs/heads/master f8c3b8bf8 -> fa6e9ca8a


Ensure the log output always has one line of non-files so split works right

On older versions of git (e.g. 1.8) a blank line would be included always.
On newer versions (e.g. 2.x) there would be no blank line with 'format:'
thus causing the first filename to be missed.


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

Branch: refs/heads/master
Commit: c80c80fa8438c9d87b9205c3e78a752715c3148c
Parents: 27c46d4
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Oct 16 17:54:44 2017 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Oct 16 17:54:44 2017 -0400

----------------------------------------------------------------------
 ForgeGit/forgegit/model/git_repo.py              | 2 +-
 ForgeGit/forgegit/tests/model/test_repository.py | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/c80c80fa/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 52e1c6e..ebaf155 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -650,7 +650,7 @@ class GitImplementation(M.RepositoryImplementation):
         return self._git.git.log(
             commit_id,
             name_only=True,
-            pretty='format:',
+            pretty='format:%H',
             max_count=1).splitlines()[1:]
 
     def paged_diffs(self, commit_id, start=0, end=None, onlyChangedFiles=False):

http://git-wip-us.apache.org/repos/asf/allura/blob/c80c80fa/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 222a11f..88d0455 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -523,6 +523,14 @@ By Dave Brondsema''', text_body)
                 'summary': u'Change README'},
             'name': u'README'}])
 
+    def test_ls_with_prev(self):
+        c.lcid_cache = {}  # else it'll be a mock
+
+        # build the previous last-commit-doc.  This causes different behavior when generating
the next one.
+        self.repo.commit('HEAD^').tree.ls()
+
+        self.test_ls()
+
     def test_tarball_status(self):
         tmpdir = tg.config['scm.repos.tarball.root']
         if os.path.isfile(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip")):


Mime
View raw message