libgit2如何获取当前目录的状态? [英] libgit2 how to get the the status of the current directory?
问题描述
我如何获得单个目录的状态,而不是整个存储库?
-
git_status_list_new
它获取存储库状态,但我只关心位于单个目录中的文件。 / p> -
git_status_file
它可以获得单一的状态。 b
有没有一种方法可以使用libgit2来获取单个目录的状态?
git_status_options
结构,其中包含 pathspec
成员控制哪些文件将包含在列表中。您可以使用它来限制您返回的状态为单个目录中的状态。
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?
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.
这篇关于libgit2如何获取当前目录的状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!