Skip to content

Commit

Permalink
fix: Git integration no longer fails to stage deleted files
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlin7 committed Jul 18, 2023
1 parent 3177f29 commit 1c34b4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion biscuit/core/components/git/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ def get_latest_commit(self):

def get_commit_filedata(self, filename):
return self.head.commit.tree[filename].data_stream.read().decode('utf-8')

def stage_files(self, *paths):
for path, change_type in paths:
if change_type == 'D':
print(path, change_type)
# change type can be 0, 1, 2, 3
# respectively represents Deleted, Added, Modified, Untracked
if change_type == 0:
self.do(self.index.remove, [path])
else:
self.do(self.index.add, [path])
Expand Down

0 comments on commit 1c34b4f

Please sign in to comment.