1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-11-26 22:49:49 +01:00

Fix 'git-obs pr dump' to support adding more keys to the submodule metadata

This commit is contained in:
2025-08-26 15:15:34 +02:00
parent e786a634dd
commit 6d88e807bf

View File

@@ -294,7 +294,13 @@ class PullRequestDumpCommand(osc.commandline_git.GitObsCommand):
else:
for key in ["branch", "path", "url"]:
# we don't expect migrating packages to another paths, branches etc.
assert base_submodules[i].get(key, None) == head_submodules[i].get(key, None)
if key not in base_submodules[i] and key in head_submodules[i]:
# we allow adding new keys in the pull request to fix missing data
pass
else:
base_value = base_submodules[i].get(key, None)
head_value = head_submodules[i].get(key, None)
assert base_value == head_value, f"Submodule metadata has changed: key='{key}', base_value='{base_value}', head_value='{head_value}'"
base_commit = base_submodules[i].get("commit","")
head_commit = head_submodules[i].get("commit","")