Reputation: 53
Using libgit2, I am able to do the equivalent of git add
with git_index_add
, but I am struggling to figure out how to achieve the equivalent of git rm
on a file that has been deleted.
Upvotes: 1
Views: 345
Reputation: 5277
You do that with the git_index_remove
function. As stage you'll probably want 0 (assuming you're not dealing with conflicts). It doesn't matter whether the file exists on the filesystem or not.
Upvotes: 1