mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
Cache calls to GitRepo::getWorkdirInfo()
A command like `nix flake metadata` was causing about 4 calls to getWorkdirInfo(), which is slow for large repos (even when they're not dirty).
This commit is contained in:
parent
f469bc2ae4
commit
7ba933e989
3 changed files with 17 additions and 1 deletions
|
@ -70,6 +70,8 @@ struct GitRepo
|
|||
|
||||
virtual WorkdirInfo getWorkdirInfo() = 0;
|
||||
|
||||
static WorkdirInfo getCachedWorkdirInfo(const std::filesystem::path & path);
|
||||
|
||||
/* Get the ref that HEAD points to. */
|
||||
virtual std::optional<std::string> getWorkdirRef() = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue