diff --git a/diffGitHub_pullrequest.m b/diffGitHub_pullrequest.m index 3dca22d..f39978c 100644 --- a/diffGitHub_pullrequest.m +++ b/diffGitHub_pullrequest.m @@ -8,7 +8,7 @@ function diffGitHub_pullrequest(branchname) gitCommand = sprintf('git --no-pager diff --name-only origin/main..origin/%s ***.slx', branchname); [status,modifiedFiles] = system(gitCommand); assert(status==0, modifiedFiles); - modifiedFiles = split(modifiedFiles); + modifiedFiles = splitlines(modifiedFiles); modifiedFiles(end) = []; % Removing last element because it is empty if isempty(modifiedFiles) @@ -57,7 +57,7 @@ function diffGitHub_pullrequest(branchname) ancestor = strrep(sprintf('%s%s%s',ancestor, "_ancestor", ext), '\', '/'); % Build git command to get ancestor from main % git show origin/main:models/modelname.slx > modelscopy/modelname_ancestor.slx - gitCommand = sprintf('git --no-pager show origin/main:%s > %s', fileName, ancestor); + gitCommand = sprintf('git --no-pager show origin/main:\"%s\" > \"%s\"', fileName, ancestor); [status, result] = system(gitCommand); assert(status==0, result); diff --git a/diffGitHub_push.m b/diffGitHub_push.m index a6bcf28..2c53d6c 100644 --- a/diffGitHub_push.m +++ b/diffGitHub_push.m @@ -8,7 +8,7 @@ function diffGitHub_push(lastpush) gitCommand = sprintf('git --no-pager diff --name-only %s ***.slx', lastpush); [status,modifiedFiles] = system(gitCommand); assert(status==0, modifiedFiles); - modifiedFiles = split(modifiedFiles); + modifiedFiles = splitlines(modifiedFiles); modifiedFiles(end) = []; % Removing last element because it is empty if isempty(modifiedFiles) @@ -56,7 +56,7 @@ function diffGitHub_push(lastpush) % Build git command to get ancestor % git show lastpush:models/modelname.slx > modelscopy/modelname_ancestor.slx - gitCommand = sprintf('git --no-pager show %s:%s > %s', lastpush, fileName, ancestor); + gitCommand = sprintf('git --no-pager show %s:\"%s\" > \"%s\"', lastpush, fileName, ancestor); [status, result] = system(gitCommand); assert(status==0, result);