Skip to content

Commit

Permalink
remove force
Browse files Browse the repository at this point in the history
  • Loading branch information
CTY-git committed Sep 13, 2024
1 parent d92de88 commit 1cf0b3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion patchwork/steps/CommitChanges/CommitChanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def run(self) -> dict:
repo = git.Repo(cwd, search_parent_directories=True)
repo_dir_path = Path(repo.working_tree_dir)
repo_changed_files = {repo_dir_path / item.a_path for item in repo.index.diff(None)}
repo_ignored_files = repo.ignored(*repo_changed_files)
repo_changed_files = repo_changed_files.difference(repo_ignored_files)
repo_untracked_files = {repo_dir_path / item for item in repo.untracked_files}
modified_files = {Path(modified_code_file["path"]).resolve() for modified_code_file in self.modified_code_files}
true_modified_files = modified_files.intersection(repo_changed_files.union(repo_untracked_files))
Expand All @@ -150,7 +152,7 @@ def run(self) -> dict:
to_branch,
):
for modified_file in true_modified_files:
repo.git.add("-f", modified_file)
repo.git.add(modified_file)
commit_with_msg(repo, f"Patched {modified_file}")

return dict(
Expand Down

0 comments on commit 1cf0b3b

Please sign in to comment.