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