[projects/git-slug: 94/170] Split initialization of git directory and adding of remotes

glen glen at pld-linux.org
Mon Sep 21 21:46:42 CEST 2015


commit dbc986be62bfd5e5722135d59dc075ef07c99e81
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Wed Mar 14 18:07:06 2012 +0000

    Split initialization of git directory and adding of remotes

 git_slug/gitrepo.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/git_slug/gitrepo.py b/git_slug/gitrepo.py
index 2bb59e8..578d8b8 100644
--- a/git_slug/gitrepo.py
+++ b/git_slug/gitrepo.py
@@ -61,7 +61,7 @@ class GitRepo:
         clist += [ remotename ] + fetchlist
         return self.commandexc(clist)
 
-    def init(self, remotepull, remotepush = None, remotename=REMOTE_NAME):
+    def init_gitdir(self):
         clist = ['git', 'init']
         if os.path.dirname(self.gdir) == self.wtree:
             clist.append(self.wtree)
@@ -69,6 +69,9 @@ class GitRepo:
             clist.extend(['--bare', self.gdir])
         if subprocess.call(clist):
             raise GitRepoError(self.gdir)
+
+    def init(self, remotepull, remotepush = None, remotename=REMOTE_NAME):
+        self.init_gitdir()
         self.commandio(['remote', 'add', remotename, remotepull])
         if remotepush is not None:
             self.commandio(['remote', 'set-url', '--push', remotename, remotepush])
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list