mathworks / Simulink-Model-Comparison-for-GitHub-Pull-Requests

Files demonstrating how to diff Simulink models and attach reports to pull requests
Other
26 stars 4 forks source link

Simulink Model Comparison does not work when new .slx files are added in the project. #4

Open ojas-pixxel opened 1 year ago

ojas-pixxel commented 1 year ago

When a completely new .slx file is added to a Simulink Project and the following .m file is ran, the following error is observed.

{Error using assert fatal: path 'new_simulink_file.slx' exists on disk, but not in 'refs/remotes/origin/main'

Error in diffGitHub_pullrequest>getAncestor (line 63) assert(status==0, result);

Error in diffGitHub_pullrequest>diffToAncestor (line 39) ancestor = getAncestor(tempdir,fileName);

Error in diffGitHub_pullrequest (line 27) report = diffToAncestor(tempdir,string(modifiedFiles(i)));

} exit status 1

Checking if every simulink file has an ancestor and if not, adding such Simulink files in a new report could be a possible alternative.

ojas-pixxel commented 1 year ago

Hey @rnakhoul, any idea when this issue could be closed? Thanks for maintaining this Repo :)

rnakhoul commented 11 months ago

Hi. Thank you for reporting.

A quick workaround is to edit the m-file with a try catch block in the getAncestor function.