Browse Source

Merge branch 'release/1.2.0'

liuyuqi-dellpc 1 year ago
parent
commit
56502f3631

+ 3 - 2
repo_sync/platform/coding/coding.py

@@ -181,7 +181,7 @@ class CodingIE(BasePlatform):
             f'git remote add origin_coding https://{self.username}:{self.token}@e.coding.net/{self.username}/{self.project_name}/{repo_name}.git'
         )
         result = subprocess.run(
-            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_coding {current_branch}')
         os.system('git remote remove origin_coding')
@@ -202,7 +202,8 @@ class CodingIE(BasePlatform):
         os.system(
             f'git remote add origin_coding https://{self.username}:{self.token}@e.coding.net/{self.username}/{self.project_name}/{repo_name}.git'
         )
-        result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+        result = subprocess.run(
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_coding {current_branch}')
         

+ 5 - 3
repo_sync/platform/gitee.py

@@ -48,7 +48,7 @@ class GiteeIE(BasePlatform):
             print(f'Repository: {repo_name} deleted from gitee successfully!')
         else:
             print(
-                f'Failed to delete repository: {repo_name} from github. Error {response.status_code}: {response.text}'
+                f'Failed to delete repository: {repo_name} from gitee. Error {response.status_code}: {response.text}'
             )
 
     def get_repo_list(self) -> list:
@@ -85,7 +85,8 @@ class GiteeIE(BasePlatform):
         os.system(
             f'git remote add origin_gitee https://{self.username}:{self.token}@gitee.com/{self.username}/{repo_name}.git'
         )
-        result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+        result = subprocess.run(
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_gitee {current_branch}')
         os.system('git remote remove origin_gitee')
@@ -102,7 +103,8 @@ class GiteeIE(BasePlatform):
         os.system(
             f'git remote add origin_gitee https://{self.username}:{self.token}@gitee.com/{self.username}/{repo_name}.git'
         )
-        result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+        result = subprocess.run(
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_gitee {current_branch}')
         

+ 3 - 2
repo_sync/platform/github.py

@@ -80,7 +80,7 @@ class GithubIE(BasePlatform):
         os.system(
             f'git remote add origin_github  https://{self.username}:{self.token}@github.com/{self.username}/{repo_name}.git')
         result = subprocess.run(
-            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_github {current_branch}')
         os.system('git remote remove origin_github')
@@ -104,7 +104,8 @@ class GithubIE(BasePlatform):
         os.system(
             f'git remote add origin_github https://{self.username}:{self.token}@github.com/{self.username}/{repo_name}.git'
         )
-        result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+        result = subprocess.run(
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_github {current_branch}')
         

+ 4 - 2
repo_sync/platform/gitlab.py

@@ -99,7 +99,8 @@ class GitlabIE(BasePlatform):
         os.system(
             f"git remote add origin_gitlab https://{self.username}:{self.token}@{pur_host}/{self.username}/{repo_name}.git"
         )
-        result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+        result = subprocess.run(
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_gitlab {current_branch}')
         os.system("git remote remove origin_gitlab")
@@ -124,7 +125,8 @@ class GitlabIE(BasePlatform):
         os.system(
             f"git remote add origin_gitlab https://{self.username}:{self.token}@{pur_host}/{self.username}/{repo_name}.git"
         )
-        result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+        result = subprocess.run(
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_gitlab {current_branch}')
         

+ 4 - 2
repo_sync/platform/gogs.py

@@ -99,7 +99,8 @@ class GogsIE(BasePlatform):
         os.system(
             f'git remote add origin_gogs https://{self.username}:{self.token}@{pur_host}/{self.username}/{repo_name}.git'
         )
-        result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+        result = subprocess.run(
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_gogs {current_branch}')
         os.system('git remote remove origin_gogs')
@@ -118,7 +119,8 @@ class GogsIE(BasePlatform):
         os.system(
             f'git remote add origin_gogs https://{self.username}:{self.token}@{pur_host}/{self.username}/{repo_name}.git'
         )
-        result = subprocess.run(['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True)
+        result = subprocess.run(
+            ['git', 'symbolic-ref', '--short', 'HEAD'], capture_output=True, text=True, encoding='utf-8')
         current_branch = result.stdout.strip()
         os.system(f'git pull origin_gogs {current_branch}')
         os.system(f'git push -u origin_gogs {current_branch}')