Commit f78fddea authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

ita_git_commit_id: fixed warnings and doc

parent b95c202b
......@@ -5,14 +5,14 @@ function [gitCommitID, currentBranch] = ita_git_commit_id(varargin)
% Returns an empty string (''), if ID / branch cannot be determined.
%
% Syntax:
% gitCommitID = ita_git_commit_id()
% [gitCommitID, currentBranch] = ita_git_commit_id()
%
% Reference page in Help browser
% <a href="matlab:doc ita_git_commit_id">doc ita_git_commit_id</a>
%
% Autor: Philipp Schfer -- Email: psc@akustik.rwth-aachen.de
% Created: 04 Apr 2021
% Autor: Philipp Schaefer -- Email: psc@akustik.rwth-aachen.de
% Created: 15 Apr 2021
% <ITA-Toolbox>
% This file is part of the ITA-Toolbox. Some rights reserved.
......@@ -24,17 +24,16 @@ gitCommitID = '';
currentBranch = '';
%% Find git folder
gitFolder = fullfile(ita_toolbox_path, '.git');
gitFolder = fullfile(ita_toolbox_path, '.git');
if ~exist(gitFolder, 'dir')
ita_verbose_info('No git folder found. Did you download the ITA Toolbox instead of cloning it?')
ita_verbose_info([upper(mfilename()) ': No git folder found. Did you download the ITA Toolbox instead of cloning it?'])
return;
end
%% Find current branch
headFile = fullfile(gitFolder, 'HEAD');
if ~exist(headFile, 'file')
%Warning required?
%warning([upper(mfilename) ': ...'])
ita_verbose_info([upper(mfilename()) ': Cannot find git head!'])
return;
end
......@@ -47,8 +46,7 @@ currentBranch = strrep(txt{2}, 'refs/heads/', '');
%% Find current commit ID
if ~exist(branchFile, 'file')
%Warning required?
%warning([upper(mfilename) ': ...'])
ita_verbose_info([upper(mfilename()) ': Cannot find commit of current branch!'])
return;
end
txt = txt_fileread(branchFile);
......
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