Commit 7fd5a63f authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Use configured remote when setting repo url

Set sickbeard.BRANCH whenever we list branches (to prevent sr config being out of sync when also using cli)
parent 579792e0
......@@ -773,4 +773,4 @@
//-->
</script>
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')
\ No newline at end of file
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')
......@@ -654,7 +654,7 @@ def initialize(consoleLogging=True):
# git_remote
GIT_REMOTE = check_setting_str(CFG, 'General', 'git_remote', 'origin')
GIT_REMOTE_URL = check_setting_str(CFG, 'General', 'git_remote_url',
'https://github.com/SiCKRAGETV/SickRage.git')
'[email protected]github.com:SiCKRAGETV/SickRage.git')
# current commit hash
CUR_COMMIT_HASH = check_setting_str(CFG, 'General', 'cur_commit_hash', '')
......
......@@ -293,9 +293,7 @@ class GitUpdateManager(UpdateManager):
self.github_org = self.get_github_org()
self.github_repo = self.get_github_repo()
self.branch = sickbeard.BRANCH
if sickbeard.BRANCH == '':
self.branch = self._find_installed_branch()
sickbeard.BRANCH = self.branch = self._find_installed_branch()
self._cur_commit_hash = None
self._newest_commit_hash = None
......@@ -393,7 +391,7 @@ class GitUpdateManager(UpdateManager):
exit_status = 1
elif exit_status == 128 or 'fatal:' in output or err:
logger.log(cmd + u" returned : " + str(output), logger.ERROR)
logger.log(cmd + u" returned : " + str(output), logger.WARNING)
exit_status = 128
else:
......@@ -429,6 +427,7 @@ class GitUpdateManager(UpdateManager):
if exit_status == 0 and branch_info:
branch = branch_info.strip().replace('refs/heads/', '', 1)
if branch:
sickbeard.BRANCH = branch
return branch
return ""
......@@ -585,6 +584,7 @@ class GitUpdateManager(UpdateManager):
def list_remote_branches(self):
# update remote origin url
self.update_remote_origin()
sickbeard.BRANCH = self._find_installed_branch()
branches, err, exit_status = self._run_git(self._git_path, 'ls-remote --heads %s' % sickbeard.GIT_REMOTE) # @UnusedVariable
if exit_status == 0 and branches:
......@@ -593,7 +593,7 @@ class GitUpdateManager(UpdateManager):
return []
def update_remote_origin(self):
self._run_git(self._git_path, 'config remote.origin.url %s' % sickbeard.GIT_REMOTE_URL)
self._run_git(self._git_path, 'config remote.%s.url %s' % (sickbeard.GIT_REMOTE, sickbeard.GIT_REMOTE_URL))
class SourceUpdateManager(UpdateManager):
def __init__(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment