Reputation: 65
How can I get the status of a single directory, rather than the whole repository?
I have looked at the following:
git_status_list_new
which gets the repository status, but I care only about files located in a single directory.
git_status_file
which gets the status of a single.
Is there a way that I can get the status of a single directory using libgit2?
Upvotes: 0
Views: 714
Reputation: 73530
git_status_list_new
accepts a git_status_options
struct, which contains a pathspec
member which controls which files will be included in the list. You can use that to limit your returned statuses to those in a single directory.
Upvotes: 2