[neon-notifications] Changes in repo-metadata

Neon CI noreply at kde.org
Sun Jul 2 19:46:19 BST 2023


commit 7046b999a73818290dfea2d759db73fa0180ef22
Author: Phu Nguyen <phu.nguyen at kdemail.net>
Date:   Sat Jul 1 19:42:07 2023 +0000

    Get branch name once instead of repeatedly and incorrectly

diff --git a/git-helpers/git-kclone b/git-helpers/git-kclone
index 44859e4b..de949205 100755
--- a/git-helpers/git-kclone
+++ b/git-helpers/git-kclone
@@ -111,6 +111,16 @@ if len(reposToClone) == 0:
     print("KClone could not locate the project you specified")
     sys.exit(10)
 
+# We want to clone the repos with their default branches first so it does not fail if the
+# requested branch does not exist. So we fetch the branch name here and remove the
+# argument from argv.
+# Note: We do not check the existence of the branch remotely because that would double our server requests.
+branchName = ""
+for arg in sys.argv[2:]:
+    if arg.startswith("--branch"):
+        branchName = arg.split('=')[1]
+        sys.argv.remove(arg)
+
 # Now it is time to start cloning repositories!
 for repository in reposToClone:
     # Check to see if we already have something on disk....
@@ -118,16 +128,6 @@ for repository in reposToClone:
         print("WARNING: The repository '{0}' already exists - skipping".format( repository['identifier'] ))
         continue
 
-    # We want to clone the repo with its default branch first so it does not fail if the
-    # requested branch does not exist. So we fetch the branch name here and remove the
-    # argument from argv.
-    # Note: We do not check the existence of the branch remotely because that would double our server requests.
-    branchName = ""
-    for arg in sys.argv[2:]:
-        if arg.startswith("--branch"):
-            branchName = arg.split('=')[1]
-            sys.argv.remove(arg)
-
     # Assemble our clone command
     # We ignore the first item in argv (our script name) along with the second (which is the pattern
     # we processed earlier) and assume everything else is a parameter to pass to git



More information about the neon-notifications mailing list