Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo.reset_index is broken #1072

Closed
sattlerc opened this issue Oct 21, 2022 · 0 comments · Fixed by #1073
Closed

Repo.reset_index is broken #1072

sattlerc opened this issue Oct 21, 2022 · 0 comments · Fixed by #1073

Comments

@sattlerc
Copy link
Contributor

Suppose I have a repository with a staged file:

mkdir test-repo
cd test-repo
git init
git commit --allow-empty --allow-empty-message -m ''
touch file
git add file

Then I reset the index using dulwich:

import dulwich.repo
r = dulwich.repo.Repo('test-repo')
r.reset_index()

However, the index is not reset. It still contains file.

The cause seems to be in build_index_from_tree. The documentation claims that the existing index is wiped. However, the function starts with:

index = Index(index_path)

This reads in the existing content of the index.

sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 21, 2022
sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 21, 2022
sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 21, 2022
sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 21, 2022
sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 21, 2022
sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 21, 2022
sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 22, 2022
sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 22, 2022
sattlerc added a commit to ncatlab/instiki2git that referenced this issue Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant