mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Add submodule support to the git support.
This commit is contained in:
@@ -94,6 +94,9 @@ class repo:
|
|||||||
def checkout(self, branch = 'master'):
|
def checkout(self, branch = 'master'):
|
||||||
ec, output = self._run(['checkout', branch], check = True)
|
ec, output = self._run(['checkout', branch], check = True)
|
||||||
|
|
||||||
|
def submodule(self, module):
|
||||||
|
ec, output = self._run(['submodule', 'update', '--init', module], check = True)
|
||||||
|
|
||||||
def status(self):
|
def status(self):
|
||||||
_status = {}
|
_status = {}
|
||||||
if path.exists(self.path):
|
if path.exists(self.path):
|
||||||
@@ -109,6 +112,8 @@ class repo:
|
|||||||
state = 'unstaged'
|
state = 'unstaged'
|
||||||
elif l.startswith('# Untracked files:'):
|
elif l.startswith('# Untracked files:'):
|
||||||
state = 'untracked'
|
state = 'untracked'
|
||||||
|
elif l.startswith('# HEAD detached'):
|
||||||
|
state = 'detached'
|
||||||
elif state != 'none' and l[0] == '#':
|
elif state != 'none' and l[0] == '#':
|
||||||
if l.strip() != '#' and not l.startswith('# ('):
|
if l.strip() != '#' and not l.startswith('# ('):
|
||||||
if state not in _status:
|
if state not in _status:
|
||||||
|
Reference in New Issue
Block a user