#1184 config: Fix getting default branch in SCM dict
Merged 4 years ago by lsedlar. Opened 4 years ago by lsedlar.
lsedlar/pungi scm-default  into  master

file modified
+2 -1
@@ -305,7 +305,8 @@ 

                  and "repo" in instance[property]

              ):

                  instance[property]["branch"] = resolver(

-                     instance[property]["repo"], instance[property].get("branch", "HEAD")

+                     instance[property]["repo"],

+                     instance[property].get("branch") or "HEAD",

                  )

  

          for error in _hook_errors(properties, instance, schema):

If user configures branch as explicit None, we want to default to HEAD (which is most likely refs/heads/master in git).

The original code was getting branch as None, which lead to wrong resolver being used and the repo url being used as branch.

Fixes: https://pagure.io/pungi/issue/1181

rebased onto 9517df4

4 years ago

Pull-Request has been merged by lsedlar

4 years ago