Skip to content

Commit 54b7dd9

Browse files
lbarcziovanforro
andcommitted
Apply suggestions from code review
Co-authored-by: Nikola Forró <[email protected]>
1 parent a6c934f commit 54b7dd9

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

agents/rebase_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def get_instructions() -> str:
9090
6. Upload new upstream sources (files that the `spectool` command downloaded in the previous step)
9191
to lookaside cache using the `upload_sources` tool.
9292
93-
7. If you removed any patch files from the spec file (e.g. because they were already applied upstream),
94-
you must delete those patch files using `rm` command from the repository as well.
93+
7. If you removed any patch file references from the spec file (e.g. because they were already applied upstream),
94+
you must remove all the corresponding patch files from the repository as well.
9595
9696
8. Generate a SRPM using `centpkg --name=<PACKAGE> --namespace=rpms --release=<DIST_GIT_BRANCH> srpm`.
9797

agents/tasks.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,13 @@ async def stage_changes(
8484
if isinstance(files_to_commit, str):
8585
files_to_commit = [files_to_commit]
8686

87-
# Get currently staged files
88-
_, stdout, _ = await run_subprocess(
89-
["git", "diff", "--cached", "--name-only"],
90-
cwd=local_clone
91-
)
92-
already_staged = set(stdout.strip().split('\n')) if stdout and stdout.strip() else set()
93-
94-
# Stage each file
9587
for file in files_to_commit:
96-
if file in already_staged:
97-
logger.info(f"Skipping already staged: {file}")
98-
continue
99-
10088
logger.info(f"Staging: {file}")
10189
exit_code, _, stderr = await run_subprocess(
10290
["git", "add", "--all", file],
10391
cwd=local_clone
10492
)
93+
# for the case agent already staged deleted file which leads to error
10594
if exit_code != 0:
10695
logger.warning(f"Failed to stage {file}: {stderr}")
10796

0 commit comments

Comments
 (0)