Browse Source

Merge pull request #752 from meolu/2.1/hotfix/tag-deploy

2.1/hotfix/tag deploy
walle-web.io 6 years ago
parent
commit
47b83c309b
1 changed files with 12 additions and 1 deletions
  1. 12 1
      walle/service/git/repo.py

+ 12 - 1
walle/service/git/repo.py

@@ -76,9 +76,20 @@ class Repo:
         PyRepo(self.path).git.checkout(branch)
 
     def checkout_2_commit(self, branch, commit):
-        PyRepo(self.path).head.set_reference(branch)
+        '''
+        @todo 未完成
+        @param branch:
+        @param commit:
+        @return:
+        '''
+        PyRepo(self.path).git.checkout(branch)
+        # PyRepo(self.path).head.set_reference(branch)
+        # 方法有问题,只是做了reset,没有checkout
         PyRepo(self.path).head.set_commit(commit)
 
+    def checkout_2_tag(self, tag):
+        PyRepo(self.path).git.checkout(tag)
+
     def branches(self):
         '''
         获取所有分支