浏览代码

walle 2.1 - fix: #627 优化上线的branch/tag/commit获取,稳定且提速获取

walle 6 年之前
父节点
当前提交
1de28506d8
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      walle/service/git/repo.py

+ 5 - 5
walle/service/git/repo.py

@@ -45,10 +45,10 @@ class Repo:
         if not os.path.exists(self.path):
             os.makedirs(self.path)
         # git clone
-        if not self.is_git_dir():
-            return self.clone(url)
-        else:
+        if self.is_git_dir():
             return self.pull()
+        else:
+            return self.clone(url)
 
     def clone(self, url):
         '''
@@ -69,8 +69,8 @@ class Repo:
         @return:
         '''
         repo = PyRepo(self.path)
-        print(repo.active_branch)
-        return repo.remote().pull(repo.active_branch)
+
+        return repo.remote().pull()
 
     def checkout_2_branch(self, branch):
         PyRepo(self.path).git.checkout(branch)