eric6/Plugins/VcsPlugins/vcsGit/git.py

changeset 8259
2bbec88047dd
parent 8240
93b8a353c4bf
child 8273
698ae46f40a4
diff -r 82b608e352ec -r 2bbec88047dd eric6/Plugins/VcsPlugins/vcsGit/git.py
--- a/eric6/Plugins/VcsPlugins/vcsGit/git.py	Wed Apr 21 17:56:12 2021 +0200
+++ b/eric6/Plugins/VcsPlugins/vcsGit/git.py	Wed Apr 21 19:40:50 2021 +0200
@@ -1383,15 +1383,16 @@
         ]
         
         ignoreName = os.path.join(name, Git.IgnoreFileName)
-        if os.path.exists(ignoreName):
-            res = E5MessageBox.yesNo(
+        res = (
+            E5MessageBox.yesNo(
                 self.__ui,
                 self.tr("Create {0} file").format(ignoreName),
                 self.tr("""<p>The file <b>{0}</b> exists already."""
                         """ Overwrite it?</p>""").format(ignoreName),
                 icon=E5MessageBox.Warning)
-        else:
-            res = True
+            if os.path.exists(ignoreName) else
+            True
+        )
         if res:
             try:
                 # create a .gitignore file

eric ide

mercurial