1 function [gitMsgLineList, varargout]=
gitcall(ParamStr,pathStr)
5 % call git with the given parameter
string 11 callStr=sprintf(
'git %s',ParamStr);
13 callStr=[
'TERM=ansi ',callStr];
16 [gitErr,gitMsg]=system(callStr);
21 % create cellstring with one row per line
22 gitMsgLineList=strsplit(gitMsg,sprintf(
'\r\n'));
24 % check
for an error reported by the operating system
26 % an error is reported
27 if isempty(gitMsgLineList)
28 SMsg(1).identifier=
'GIT:versioningProblem';
29 SMsg(1).message=[
'Problem using version control system:' 10 ...
30 ' Git could not be executed! Error code is ' ...
31 num2str(gitErr) 10
' Path is ' gitDirStr];
32 elseif strncmp(
'''git
',gitMsgLineList{1},4) 33 SMsg(1).identifier='GIT:installationProblem
'; 34 SMsg(1).message=['Problem
using version control system:
' 10 ... 35 ' Git could not be executed!
' 10 'Path is
' gitDirStr]; 37 SMsg(1).identifier='GIT:versioningProblem
'; 38 SMsg(1).message=['Problem
using version control system:
' 10 ... 39 mxberry.core.cell.cellstr2colstr(gitMsgLineList,' ') 10 ' Path is
' gitDirStr]; 41 elseif ~isempty(gitMsgLineList) 42 if strncmp('git:
',gitMsgLineList{1},4) 43 SMsg(1).identifier='GIT:versioningProblem
'; 44 SMsg(1).message=['Problem
using version control system:
' 10 ... 45 mxberry.core.cell.cellstr2colstr(gitMsgLineList,' ') 10 ... 46 ' Path is
' gitDirStr]; function gitcall(in ParamStr, in pathStr)