Jonse Jonse
Jonse Jonse

Reputation: 65

libgit2 how to get the the status of the current directory?

How can I get the status of a single directory, rather than the whole repository?

I have looked at the following:

Is there a way that I can get the status of a single directory using libgit2?

Upvotes: 0

Views: 714

Answers (1)

Michael Anderson
Michael Anderson

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

Related Questions