Commit 48dedd42 authored by Jan-Gerrit Richter's avatar Jan-Gerrit Richter

added persistent variables to git commit hash to reduce time

parent 0ab2229f
......@@ -13,6 +13,7 @@ function commitID = ita_git_getMasterCommitHash(varargin)
% Options (default):
% 'branch' (master) : the branch of the returned commit id
% 'path' (ita_toolbox_path) : the path of the repository
% 'force' (false) : force a new update on the commit id
%
%
% See also:
......@@ -30,12 +31,25 @@ function commitID = ita_git_getMasterCommitHash(varargin)
% Author: Jan-Gerrit Richter -- Email: jri@akustik.rwth-aachen.de
% Created: 13-Sep-2017
persistent oldArgs;
persistent oldID;
sArgs.branch = 'master';
sArgs.path = '';
sArgs.force = 0;
sArgs = ita_parse_arguments(sArgs,varargin);
if ~isempty(oldID)
if isequaln(oldArgs,sArgs)
if ~sArgs.force
commitID = oldID;
return;
end
end
end
if isempty(sArgs.path)
repPath = ita_toolbox_path;
else
......@@ -54,6 +68,9 @@ try
commitID = '';
end
cd(workingDir);
oldID = commitID;
oldArgs = sArgs;
catch e
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment