You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2017/10/21 09:40:16 UTC

[kibble-scanners] branch master updated: we also accept trunk as a default, if no master

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git


The following commit(s) were added to refs/heads/master by this push:
     new 462e914  we also accept trunk as a default, if no master
462e914 is described below

commit 462e914f64e1912dfe2b49cf0ec141c2079e0b9d
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sat Oct 21 11:40:09 2017 +0200

    we also accept trunk as a default, if no master
---
 src/plugins/utils/git.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/utils/git.py b/src/plugins/utils/git.py
index 23e773e..816bac1 100644
--- a/src/plugins/utils/git.py
+++ b/src/plugins/utils/git.py
@@ -34,10 +34,10 @@ def defaultBranch(source, datapath):
             try:
                 inp = subprocess.check_output("cd %s && git branch -a | awk -F ' +' '! /\(no branch\)/ {print $2}'" % datapath,  shell = True, stderr=subprocess.DEVNULL).decode('ascii', 'replace').split()
                 if len(inp) > 0:
-                    for b in inp:
+                    for b in sorted(inp):
                         if b.find("detached") == -1:
                             branch = str(b.replace("remotes/origin/", "", 1))
-                            if branch == 'master':
+                            if branch == 'master' or branch == "trunk":
                                 break
             except:
                 branch = ""

-- 
To stop receiving notification emails like this one, please contact
['"commits@kibble.apache.org" <co...@kibble.apache.org>'].