From e66109a13d8d3a6393e5c3255239c9ec2971d07c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 2 Feb 2021 01:52:06 +0000 Subject: cleanup some code --- src/backend/sync.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/backend') diff --git a/src/backend/sync.py b/src/backend/sync.py index ebea39c..5d3c098 100644 --- a/src/backend/sync.py +++ b/src/backend/sync.py @@ -4,26 +4,23 @@ import os import subprocess import sisyphus.filesystem +localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) +remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) + def portage(): os.chdir(sisyphus.filesystem.portageRepoDir) - localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) - remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) gitExecStage1 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE) gitExecStage1.wait() def overlay(): os.chdir(sisyphus.filesystem.redcoreRepoDir) - localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) - remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) gitExecStage1 = subprocess.Popen(['git', 'reset', '--hard'] + remoteBranch.decode().strip().replace('refs/remotes/','').split() + ['--quiet'], stdout=subprocess.PIPE) gitExecStage1.wait() def portageCfg(): os.chdir(sisyphus.filesystem.portageConfigDir) - localBranch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) - remoteBranch = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}']) gitExecStage1 = subprocess.Popen(['git', 'stash'], stdout=subprocess.PIPE) gitExecStage1.wait() -- cgit v1.2.3