Skip to content

Commit 8440f70

Browse files
committed
feat: Add status output
1 parent 0403c2a commit 8440f70

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

git.m

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function cmdout = git(varargin)
1+
function [cmdout, statout] = git(varargin)
22
% A thin MATLAB wrapper for Git.
33
%
44
% Short instructions:
@@ -60,12 +60,16 @@
6060
% v0.7 09 April 2015 -- VF: If user requests it, return Git results
6161
% as a variable instead of displaying them.
6262
%
63+
% v0.8 24 Juli 2015 -- MvdL: Return status output
64+
%
65+
%
6366
% Contributors: (MR) Manu Raghavan
6467
% (TH) Timothy Hansell
6568
% (TN) Tassos Natsakis
6669
% (TP) Tyler Parsons
6770
% (HG) Han Geerligs
6871
% (VF) Vadim Frolov
72+
% (MvdL) Marcel van der Linden
6973
%
7074
orgpath=getenv('PATH');
7175
quit_function=0;
@@ -122,10 +126,11 @@
122126
answer = inputdlg('Comments:','Commit''s comments');
123127
arguments = [arguments '-m"' char(answer) '"'];
124128
end
125-
[~,result] = system(['git ',arguments,prog]);
129+
[status,result] = system(['git ',arguments,prog]);
126130
end
127131
if nargout >= 1
128132
cmdout = strtrim(result);
133+
statout = status;
129134
else
130135
% Display result instead of returning it
131136
% to suppress output of ans

0 commit comments

Comments
 (0)