From 4250871b1eb484a2186f9dd36987db24793c643c Mon Sep 17 00:00:00 2001 From: BoYanZh <32470225+BoYanZh@users.noreply.github.com> Date: Tue, 6 Oct 2020 19:41:15 +0800 Subject: update: git workflow --- worker/GitWorker.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'worker') diff --git a/worker/GitWorker.py b/worker/GitWorker.py index 3914f3c..5519451 100644 --- a/worker/GitWorker.py +++ b/worker/GitWorker.py @@ -58,9 +58,8 @@ class GitWorker(): "individual branch individual branch missing") continue repo.git.reset('--hard') - repo.git.checkout(f"{stuID}", "-f") - repo.git.pull("origin", f"{stuID}", "-f") - repo.git.reset(f"origin/{stuID}", "--hard") + repo.git.rebase(f"origin/{stuID}") + repo.git.checkout(f"{stuID}") repo.git.clean("-d", "-f", "-x") self.logger.debug(f"{repoName} {stuID} {stuName} pull succeed") if self.args.dir: @@ -228,9 +227,8 @@ class GitWorker(): scores[stuName]["projComment"].append(f"master branch missing") return scores repo.git.reset('--hard') - repo.git.checkout(f"master", "-f") - repo.git.pull("origin", "master", "-f") - repo.git.reset('--hard') + repo.git.rebase("origin/master") + repo.git.checkout("master") repo.git.clean("-d", "-f", "-x") if not list(filter(GitWorker.isREADME, os.listdir(repoDir))): self.logger.warning(f"{repoName} README file missing") -- cgit v1.2.3