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

added persistent variables to git commit hash to reduce time

parent 0ab2229f
...@@ -13,6 +13,7 @@ function commitID = ita_git_getMasterCommitHash(varargin) ...@@ -13,6 +13,7 @@ function commitID = ita_git_getMasterCommitHash(varargin)
% Options (default): % Options (default):
% 'branch' (master) : the branch of the returned commit id % 'branch' (master) : the branch of the returned commit id
% 'path' (ita_toolbox_path) : the path of the repository % 'path' (ita_toolbox_path) : the path of the repository
% 'force' (false) : force a new update on the commit id
% %
% %
% See also: % See also:
...@@ -30,12 +31,25 @@ function commitID = ita_git_getMasterCommitHash(varargin) ...@@ -30,12 +31,25 @@ function commitID = ita_git_getMasterCommitHash(varargin)
% Author: Jan-Gerrit Richter -- Email: jri@akustik.rwth-aachen.de % Author: Jan-Gerrit Richter -- Email: jri@akustik.rwth-aachen.de
% Created: 13-Sep-2017 % Created: 13-Sep-2017
persistent oldArgs;
persistent oldID;
sArgs.branch = 'master'; sArgs.branch = 'master';
sArgs.path = ''; sArgs.path = '';
sArgs.force = 0;
sArgs = ita_parse_arguments(sArgs,varargin); 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) if isempty(sArgs.path)
repPath = ita_toolbox_path; repPath = ita_toolbox_path;
else else
...@@ -54,6 +68,9 @@ try ...@@ -54,6 +68,9 @@ try
commitID = ''; commitID = '';
end end
cd(workingDir); cd(workingDir);
oldID = commitID;
oldArgs = sArgs;
catch e catch e
end 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