Skip to content

Fix support for file paths with space #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions diffGitHub_pullrequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions diffGitHub_push.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down