allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] allura git commit: Ensure the log output always has one line of non-files so split works right
Date Fri, 20 Oct 2017 20:54:04 GMT
Repository: allura
Updated Branches:
  refs/heads/db/8168 [created] a433213c7


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/c3739099
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c3739099
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c3739099

Branch: refs/heads/db/8168
Commit: c373909909c7e3e48b2c3ff3a01eb06e96a3e916
Parents: bb0326c
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Oct 16 17:54:44 2017 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Oct 20 14:43:11 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/c3739099/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/c3739099/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