6 Commits

Author SHA1 Message Date
eba3fece91 Add and remove literal files
pathspec in git has special characters that we should not trigger.
Assume every filespec as literal
2024-07-31 12:38:49 +02:00
Dirk Mueller
b74f36c81e Merge pull request 'Make sure we create devel branch, even if no diff to Factory' (#29) from adamm/git-importer:always_create_devel into use_git_for_sha256
Reviewed-on: importers/git-importer#29
2024-06-13 15:02:30 +02:00
Adam Majer
7b9b033adc Make sure we create devel branch, when no diff to Factory 2024-06-13 09:51:27 +02:00
Dirk Mueller
c44cb17e5d Merge pull request 'Ignore .osc directory' (#28) from adamm/git-importer:gitingore into use_git_for_sha256
Reviewed-on: importers/git-importer#28
Reviewed-by: Dirk Mueller <dirkmueller@noreply@src.opensuse.org>
2024-06-10 18:13:33 +02:00
Dirk Mueller
3384a6f2b1 Merge pull request 'Fix typo' (#27) from adamm/git-importer:typo into use_git_for_sha256
Reviewed-on: importers/git-importer#27
2024-06-10 18:10:40 +02:00
Adam Majer
17062df04e Fix typo 2024-06-10 15:44:21 +02:00
2 changed files with 8 additions and 3 deletions

View File

@@ -180,7 +180,7 @@ class Git:
# logging.warning(f"Error removing file {path}: {e}")
def add(self, filename):
self.git_run(["add", filename])
self.git_run(["add", ":(literal)" + filename])
def add_default_gitignore(self):
if not (self.path / ".gitignore").exists():
@@ -241,7 +241,7 @@ class Git:
def remove(self, file: pathlib.Path):
self.git_run(
["rm", "-q", "-f", "--ignore-unmatch", file.name],
["rm", "-q", "-f", "--ignore-unmatch", ":(literal)" + file.name],
)
patterns = self.get_specific_lfs_gitattributes()
if file.name in patterns:
@@ -277,7 +277,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

@@ -86,6 +86,11 @@ class GitExporter:
logging.debug(f"Committing {flat}")
self.commit_flat(flat, branch_state)
# make sure that we create devel branch
if not branch_state["devel"]:
logging.debug("force creating devel")
self.git.set_branch_head("devel", self.git.branch_head("factory"))
self.git.push(force=True)
def run_gc(self):