git - Fastest way to find out if a repo has any changes using libgit2 -


i want find fastest way of determining if has changed repo. mean if git status show else nothing commit, working directory clean

i know git_status_list_new takes 0.1 seconds on repo trying on bit long. there other function faster , works?

thanks!

use git_diff_tree_to_index , git_diff_index_to_workdir , pass notify callback cancel diff after first changed file found.

of course, in worst case, nothing has changed, isn't faster git_status_list_new.


Comments