Skip to content

Commit

Permalink
Merge pull request #1075 from projectsyn/renovate/gitpython-3.x
Browse files Browse the repository at this point in the history
Update dependency gitpython to v3.1.44
  • Loading branch information
simu authored Jan 6, 2025
2 parents 7ce4844 + 7db32ff commit c838601
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 7 additions & 3 deletions commodore/gitrepo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,16 +507,20 @@ def _compute_changed_files(
# `untracked_files` respects the repo's `.gitignore`.
to_add = self._repo.untracked_files
# We don't want to remove anything by default.
to_remove = []
to_remove: list[str] = []

# Determine changes to stage, separated into removals and other changes
changes = self._repo.index.diff(None)
if changes:
for c in changes:
if c.change_type == "D" or c.deleted_file:
if (c.change_type == "D" or c.deleted_file) and c.b_path:
# NOTE(sg): c.b_path is never None for deletions, but mypy doesn't understand
# that, so we make it explicit with `and c.b_path`.
# Track removed files for `index.remove()`
to_remove.append(c.b_path)
else:
elif c.a_path:
# NOTE(sg): c.a_path is never None for changes that aren't deletions, but mypy
# doesn't understand that, so we make it explicit with `elif c.a_path`.
# Track changes which aren't deletions for `index.add()`
to_add.append(c.a_path)

Expand Down
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ boto3 = "^1.26.145"
botocore="^1.29.145"
kapitan = "0.34.2"
click = "8.1.8"
# Kapitan requires exactly 3.1.30
gitpython = "3.1.43"
gitpython = "3.1.44"
requests = "2.32.3"
url-normalize = "1.4.3"
python-dotenv = "1.0.1"
Expand Down

0 comments on commit c838601

Please sign in to comment.