src/eric7/Plugins/VcsPlugins/vcsGit/git.py

branch
eric7
changeset 9971
773ad1f1ed22
parent 9734
74f7c9f5d094
child 9972
68ac01294544
diff -r c3686b43f76b -r 773ad1f1ed22 src/eric7/Plugins/VcsPlugins/vcsGit/git.py
--- a/src/eric7/Plugins/VcsPlugins/vcsGit/git.py	Tue Apr 04 17:26:54 2023 +0200
+++ b/src/eric7/Plugins/VcsPlugins/vcsGit/git.py	Wed Apr 05 11:58:22 2023 +0200
@@ -957,7 +957,7 @@
 
         dlg = GitMergeDialog(
             self.gitGetTagsList(repodir),
-            self.gitGetBranchesList(repodir, withMaster=True),
+            self.gitGetBranchesList(repodir),
             self.gitGetCurrentBranch(repodir),
             self.gitGetBranchesList(repodir, remotes=True),
         )
@@ -1009,7 +1009,7 @@
             self.gitGetTagsList(repodir),
             self.gitGetBranchesList(repodir),
             trackingBranchesList=self.gitGetBranchesList(repodir, remotes=True),
-            noneLabel=self.tr("Master branch head"),
+            noneLabel=self.tr("Main branch head"),
         )
         if dlg.exec() == QDialog.DialogCode.Accepted:
             rev = dlg.getRevision()
@@ -2099,14 +2099,12 @@
     ## Methods for branch handling.
     ###########################################################################
 
-    def gitGetBranchesList(
-        self, repodir, withMaster=False, allBranches=False, remotes=False
-    ):
+    def gitGetBranchesList(self, repodir, withMain=False, allBranches=False, remotes=False):
         """
         Public method to get the list of branches.
 
         @param repodir directory name of the repository (string)
-        @param withMaster flag indicating to get 'master' as well (boolean)
+        @param withMain flag indicating to get 'main' as well (boolean)
         @param allBranches flag indicating to return all branches (boolean)
         @param remotes flag indicating to return remote branches only (boolean)
         @return list of branches (list of string)
@@ -2137,7 +2135,7 @@
             for line in output.splitlines():
                 name = line[2:].strip()
                 if (
-                    (name != "master" or withMaster)
+                    (name not in ("main", "master") or withMain)
                     and "->" not in name
                     and not name.startswith("(")
                     and not name.endswith(")")
@@ -2205,7 +2203,7 @@
             return False, False
 
         dlg = GitBranchDialog(
-            self.gitGetBranchesList(repodir, withMaster=True, allBranches=True),
+            self.gitGetBranchesList(repodir, allBranches=True),
             revision,
             branchName,
             branchOp,
@@ -3882,7 +3880,7 @@
 
         dlg = GitArchiveDataDialog(
             self.gitGetTagsList(repodir),
-            self.gitGetBranchesList(repodir, withMaster=True),
+            self.gitGetBranchesList(repodir),
             self.gitGetArchiveFormats(repodir),
         )
         if dlg.exec() == QDialog.DialogCode.Accepted:

eric ide

mercurial