mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Clean up the git module.
This commit is contained in:
parent
200f0a33b6
commit
b0c2756190
@ -66,26 +66,18 @@ class repo:
|
|||||||
return (int(vs[0]), int(vs[1]), int(vs[2]), int(vs[3]))
|
return (int(vs[0]), int(vs[1]), int(vs[2]), int(vs[3]))
|
||||||
|
|
||||||
def clone(self, url, path):
|
def clone(self, url, path):
|
||||||
ec, output = self._run(['clone', url, path])
|
ec, output = self._run(['clone', url, path], check = True)
|
||||||
if ec != 0:
|
|
||||||
raise error.general('clone of %s failed: %s' % (url, output))
|
|
||||||
|
|
||||||
def fetch(self, url, path):
|
def fetch(self):
|
||||||
ec, output = self._run(['fetch', url])
|
ec, output = self._run(['fetch'], check = True)
|
||||||
if ec != 0:
|
|
||||||
raise error.general('fetch of %s failed: %s' % (url, output))
|
|
||||||
|
|
||||||
def pull(self):
|
def pull(self):
|
||||||
ec, output = self._run(['pull'])
|
ec, output = self._run(['pull'], check = True)
|
||||||
if ec != 0:
|
|
||||||
raise error.general('pull of %s failed: %s' % (url, output))
|
|
||||||
|
|
||||||
def reset(self, args):
|
def reset(self, args):
|
||||||
if type(args) == str:
|
if type(args) == str:
|
||||||
args = [args]
|
args = [args]
|
||||||
ec, output = self._run(['reset'] + args)
|
ec, output = self._run(['reset'] + args, check = True)
|
||||||
if ec != 0:
|
|
||||||
raise error.general('pull of %s failed: %s' % (url, output))
|
|
||||||
|
|
||||||
def branch(self):
|
def branch(self):
|
||||||
ec, output = self._run(['branch'])
|
ec, output = self._run(['branch'])
|
||||||
@ -96,8 +88,7 @@ class repo:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def checkout(self, branch = 'master'):
|
def checkout(self, branch = 'master'):
|
||||||
ec, output = self._run(['checkout', branch])
|
ec, output = self._run(['checkout', branch], check = True)
|
||||||
return ec == 0
|
|
||||||
|
|
||||||
def status(self):
|
def status(self):
|
||||||
_status = {}
|
_status = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user