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/08/13 23:35:52 UTC

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

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 <da...@brondsema.net>
Authored: Thu Aug 13 17:23:56 2015 -0400
Committer: Dave Brondsema <da...@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: