Skip to content

Commit 2b10d20

Browse files
authored
Merge pull request openSUSE#1921 from dmach/fix-tardiff-xz
Fix 'git-obs pr review interactive' command - support xz and obscpio tardiffs, fix head branch checkout
2 parents 6d0830b + 590b4d3 commit 2b10d20

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

osc/commands_git/pr_review_interactive.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,12 @@ def tardiff(self, owner: str, repo: str, number: int, *, pr_obj: ".PullRequest")
308308

309309
# the repo might be outdated, make sure the commits are available
310310
base_git.fetch()
311+
base_git.switch(pr_obj.base_branch)
312+
base_git.reset(pr_obj.base_commit, hard=True)
311313

312314
head_path = self.get_git_repo_path(owner, repo, number, subdir="head")
313315
if os.path.exists(head_path):
314316
# update the 'base' and 'head' worktrees to the latest revisions from the pull request
315-
base_git.reset(pr_obj.head_commit, hard=True)
316317
pr_branch = base_git.fetch_pull_request(number, commit=pr_obj.head_commit, force=True)
317318
else:
318319
# IMPORTANT: git lfs is extremly difficult to use to query files from random branches and commits.

osc/gitea_api/tardiff.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ class TarDiff:
1717
".jar",
1818
".lz",
1919
".lzma",
20+
".obscpio",
2021
".tbz",
2122
".tbz2",
2223
".tgz",
2324
".txz",
25+
".xz",
2426
".zip",
2527
".zst",
2628
]

0 commit comments

Comments
 (0)