def METHOD_NAME(self, args):
    if args.branch:
        opts = ['-c', 'advice.detachedHead=false', '-b', args.branch]
    else:
        opts = []
    git('clone', '--recurse-submodule=modules/*', *opts, '.', self.name)
    if not args.head and not args.branch:
        if stash := git_output('stash', 'create'):
            git('-C', self.name, 'fetch', '--quiet', '--no-write-fetch-head', 'origin', stash)
            git('-C', self.name, 'stash', 'apply', stash)
    if not args.no_node_modules:
        run([f'{self.name}/tools/node-modules', 'checkout'], check=True)