[damned-lies] Allow deleting a branch even when no main branch is defined



commit ce14aea323e16bceb19997fd906e13716d46853c
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Mar 23 08:34:43 2021 +0100

    Allow deleting a branch even when no main branch is defined
    
    This is the case for GNOME release notes.

 stats/repos.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/stats/repos.py b/stats/repos.py
index e8679e82..94217859 100644
--- a/stats/repos.py
+++ b/stats/repos.py
@@ -120,8 +120,9 @@ class GitRepo(RepoBase):
             if self.branch.is_head():
                 shutil.rmtree(wdir)
             else:
+                # get_branches()[0] because some modules have no main branch setup (release-notes)
                 run_shell_command(
-                    ['git', 'checkout', self.branch.module.get_head_branch().name],
+                    ['git', 'checkout', self.branch.module.get_branches()[0].name],
                     cwd=wdir
                 )
                 run_shell_command(['git', 'branch', '-D', self.branch.name], cwd=wdir)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]