mirror of
https://seed.radicle.dev/rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE.git
synced 2026-11-21 18:40:47 +08:00
refactor: add helper method to create a git repository
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
+7
-2
@@ -56,14 +56,19 @@ class Suite:
|
||||
chosen = set(methods)
|
||||
return chosen
|
||||
|
||||
def _setup(self, repo_name, shell):
|
||||
def _create_git_repo(self, repo_name):
|
||||
git = Git(os.path.join(self.tmp, repo_name))
|
||||
git.init()
|
||||
git.write("README.md", "README")
|
||||
git.commit("first commit")
|
||||
return git
|
||||
|
||||
def _setup(self, repo_name, shell):
|
||||
git = self._create_git_repo(repo_name)
|
||||
native = NativeYaml(shell)
|
||||
debug(f"native.yaml: {native.yaml()}")
|
||||
git.write(".radicle/native.yaml", native.yaml())
|
||||
git.commit("first commit")
|
||||
git.commit("add native.yaml")
|
||||
|
||||
commit = git.head()
|
||||
self.rad.init(git)
|
||||
|
||||
Reference in New Issue
Block a user