def main(args, repo): if repo: pprint.err('You are already in a Gitless repository') return False core.init_repository(url=args.repo) pprint.ok('Local repo created in {0}'.format(os.getcwd())) if args.repo: pprint.ok('Initialized from remote {0}'.format(args.repo)) return True
def main(args, repo): if repo: pprint.err('You are already in a Gitless repository') return False core.init_repository(url=args.repo, only=frozenset(args.only if args.only else []), exclude=frozenset(args.exclude if args.exclude else [])) pprint.ok('Local repo created in {0}'.format(os.getcwd())) if args.repo: pprint.ok('Initialized from remote {0}'.format(args.repo)) return True
def setUp(self): """Creates temporary local Git repo to use as the remote.""" super(TestRemote, self).setUp() # Create a repo to use as the remote self.remote_path = tempfile.mkdtemp(prefix='gl-remote-test') os.chdir(self.remote_path) remote_repo = core.init_repository() remote_repo.create_branch(REMOTE_BRANCH, remote_repo.revparse_single('HEAD')) # Go back to the original repo os.chdir(self.path) self.remotes = self.repo.remotes
def setUp(self): """Creates temporary local Git repo to use as the remote.""" super(TestRemote, self).setUp() # Create a repo to use as the remote self.remote_path = tempfile.mkdtemp(prefix='gl-remote-test') os.chdir(self.remote_path) remote_repo = core.init_repository() remote_repo.create_branch( REMOTE_BRANCH, remote_repo.revparse_single('HEAD')) # Go back to the original repo os.chdir(self.path) self.remotes = self.repo.remotes