mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Add git clean to the supported git commands.
This commit is contained in:
parent
da17bda77a
commit
1f972c2108
@ -515,6 +515,15 @@ def _git_downloader(url, local, config, opts):
|
|||||||
log.notice('git: reset: %s' % (us[0]))
|
log.notice('git: reset: %s' % (us[0]))
|
||||||
if _do_download(opts):
|
if _do_download(opts):
|
||||||
repo.reset(arg)
|
repo.reset(arg)
|
||||||
|
repo.submodule_foreach(['reset'] + arg)
|
||||||
|
elif _as[0] == 'clean':
|
||||||
|
arg = []
|
||||||
|
if len(_as) > 1:
|
||||||
|
arg = ['--%s' % (_as[1])]
|
||||||
|
log.notice('git: clean: %s' % (us[0]))
|
||||||
|
if _do_download(opts):
|
||||||
|
repo.clean(arg)
|
||||||
|
repo.submodule_foreach(['clean'] + arg)
|
||||||
elif _as[0] == 'protocol':
|
elif _as[0] == 'protocol':
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -105,6 +105,14 @@ class repo:
|
|||||||
def submodule(self, module):
|
def submodule(self, module):
|
||||||
ec, output = self._run(['submodule', 'update', '--init', module], check = True)
|
ec, output = self._run(['submodule', 'update', '--init', module], check = True)
|
||||||
|
|
||||||
|
def submodule_foreach(self, args = []):
|
||||||
|
if type(args) == str:
|
||||||
|
args = [args.split(args)]
|
||||||
|
ec, output = self._run(['submodule',
|
||||||
|
'foreach',
|
||||||
|
'--recursive',
|
||||||
|
self.git] + args, check = True)
|
||||||
|
|
||||||
def submodules(self):
|
def submodules(self):
|
||||||
smodules = {}
|
smodules = {}
|
||||||
ec, output = self._run(['submodule'], check = True)
|
ec, output = self._run(['submodule'], check = True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user