Skip to content

Commit

Permalink
Speed up git-status call.
Browse files Browse the repository at this point in the history
Since we don't display the untracked files in the git repo info, we can
simply omit them from the git-status output. This makes it considerably
faster (about 5x - ~300ms to ~60ms - in my void-packages checkout) for
no loss of functionality.
  • Loading branch information
ericonr committed Jul 25, 2021
1 parent bd30334 commit d76a879
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static void *get_git_status(void *arg)
{
struct git_info *git_info = arg;

FILE *f = popen("timeout 0.8s git status --porcelain=v1 -z 2>/dev/null", "re");
FILE *f = popen("timeout 0.8s git status --porcelain=v1 --untracked-files=no -z 2>/dev/null", "re");
if (!f)
return NULL;

Expand Down

0 comments on commit d76a879

Please sign in to comment.