I've looked in repository.h
, index.h
and didn't found how to determine if workdir has any changes? And also, if index has any staged changes? I'm not interested in details, want just overall status.
Asked
Active
Viewed 332 times
1 Answers
1
Use git_diff_index_to_workdir
to check for changes in the workdir and git_diff_tree_to_index
to get staged changes. The git_status_*
functions do both together. If you only want a yes/no answer then pass a notify callback to cancel the diff after the first changed file is found.

Jason Haslam
- 2,617
- 13
- 19