allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#7913] support new HEAD syntax from git 2.4+ log output
Date Thu, 13 Aug 2015 21:35:52 GMT
Repository: allura
Updated Branches:
  refs/heads/db/7913 [created] 2cc1761cc


[#7913] support new HEAD syntax from git 2.4+ log output


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

Branch: refs/heads/db/7913
Commit: 2cc1761cc2d701dc4b67adf9a6bc814c4f000b88
Parents: 2f144a9
Author: Dave Brondsema <dave@brondsema.net>
Authored: Thu Aug 13 17:23:56 2015 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Thu Aug 13 17:23:56 2015 -0400

----------------------------------------------------------------------
 ForgeGit/forgegit/model/git_repo.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/2cc1761c/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 480631b..a8d2e5a 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -440,12 +440,16 @@ class GitImplementation(M.RepositoryImplementation):
                 ]
                 if commit_lines:
                     hexsha, decoration = commit_lines[0].split('\x00')
-                    refs = decoration.strip(' ()').split(
-                        ', ') if decoration else []
+                    if decoration:
+                        # "->" replacement is because git 2.4 introduced "HEAD -> master"
syntax
+                        refs = decoration.strip(' ()').replace(' -> ', ', ').split(',
')
+                    else:
+                        refs = []
                     tag_prefix = 'tag: '  # introduced in git 1.8.3
                     for i, ref in enumerate(refs):
                         if ref.startswith(tag_prefix):
                             refs[i] = ref[len(tag_prefix):]
+                    refs.sort()
                     renamed = {}
                     # merge commits don't have any --name-status output
                     if len(commit_lines) > 1:


Mime
View raw message