mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-26 20:53:08 -08:00
git_version: cache the Git version
(to avoid repeated invocations of `git version`)
This commit is contained in:
@@ -89,9 +89,10 @@ static std::vector<int> parse_version (const std::string& str)
|
||||
return version;
|
||||
}
|
||||
|
||||
static std::vector<int> git_version ()
|
||||
static const std::vector<int>& git_version ()
|
||||
{
|
||||
return parse_version(git_version_string());
|
||||
static const std::vector<int> version(parse_version(git_version_string()));
|
||||
return version;
|
||||
}
|
||||
|
||||
static std::vector<int> make_version (int a, int b, int c)
|
||||
|
||||
Reference in New Issue
Block a user