1 Commits

Author SHA1 Message Date
Adam Majer
17062df04e Fix typo 2024-06-10 15:44:21 +02:00
2 changed files with 2 additions and 9 deletions

View File

@@ -85,7 +85,7 @@ class Git:
"""Checkout into the branch HEAD"""
new_branch = False
if branch not in self.branches():
self.git_run(["switch", "-q", "--orphan", branch])
self.git_run(["branch", "-q", branch, "HEAD"])
new_branch = True
else:
ref = f"refs/heads/{branch}"
@@ -182,12 +182,6 @@ class Git:
def add(self, filename):
self.git_run(["add", filename])
def add_default_gitignore(self):
if not (self.path / ".gitignore").exists():
with (self.path / ".gitignore").open("w") as f:
f.write(".osc\n")
self.add(".gitignore")
def add_default_lfs_gitattributes(self, force=False):
if not (self.path / ".gitattributes").exists() or force:
with (self.path / ".gitattributes").open("w") as f:
@@ -277,7 +271,7 @@ class Git:
["remote"],
stdout=subprocess.PIPE,
).stdout.decode("utf-8"):
logger.warning("Not pushing to remote because no 'origin' configured")
logging.warning("Not pushing to remote because no 'origin' configured")
return
cmd = ["push"]

View File

@@ -150,7 +150,6 @@ class GitExporter:
# create file if not existant
self.git.add_default_lfs_gitattributes(force=False)
self.git.add_default_gitignore()
to_download, to_delete = flat.commit.calc_delta(branch_state[flat.branch])
for file in to_delete: