40%macro mp_gitstatus(gitdir,outds=work.mp_gitstatus,mdebug=0);
43 LENGTH gitdir path $ 1024 STATUS $ 64 STAGED $ 32;
44 call missing (of _all_);
45 gitdir=symget(
'gitdir');
46 cnt=git_status(trim(gitdir));
48 put
"The libgit2 library is unavailable and no Git operations can be used.";
49 put
"See: https://stackoverflow.com/questions/74082874";
51 else if cnt=-2 then
do;
52 put
"The libgit2 library is available, but the status function failed.";
53 put
"See the log for details.";
56 rc=GIT_STATUS_GET(n,gitdir,
'PATH',path);
57 rc=GIT_STATUS_GET(n,gitdir,
'STAGED',staged);
58 rc=GIT_STATUS_GET(n,gitdir,
'STATUS',status);
60 %
if &mdebug=1 %then %
do;
64 rc=git_status_free(trim(gitdir));