Skip to content

Commit 396c742

Browse files
Conditions of rebase
1 parent f6c9ecd commit 396c742

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/checkoutBranch.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ function checkoutBranch(branchName, update_fork)
104104
% perform a rebase
105105
[status_gitRebase, result_gitRebase] = system('git rebase develop');
106106

107-
if status_gitRebase == 0 && ~isempty(strfind(result_gitRebase, 'up to date'))
107+
% if the message after rebase does not contain up to data and not cannot rebase
108+
if status_gitRebase == 0 && isempty(strfind(result_gitRebase, 'up to date')) && isempty(strfind(result_gitRebase, 'Cannot rebase'))
108109
printMsg(mfilename, ['The <', branchName, '> feature (branch) has been rebased with <develop>.']);
109110

110111
% push by force the rebased branch
@@ -122,7 +123,8 @@ function checkoutBranch(branchName, update_fork)
122123
printMsg(mfilename, ['The rebase process of <', branchName,'> with <develop> has been aborted.'], [gitCmd.fail, gitCmd.trail]);
123124
end
124125

125-
if isempty(strfind(result_gitRebase, 'Cannot rebase'))
126+
% if the message after rebase contains : cannot rebase
127+
if ~isempty(strfind(result_gitRebase, 'Cannot rebase'))
126128
% ask the user first to reset
127129
reply = input([gitCmd.lead, ' -> Do you want to reset your feature (branch) <', branchName, '>. Y/N [N]: '], 's');
128130

0 commit comments

Comments
 (0)