You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Diffing dirty submodule: Cannot read property 'old_mode' of null #828
I have three submodules in the project directory. Two of them have local commits and thus their subprojects are dirty. The third one has unstaged changes for that git repo but clicking on the submodule inside the 'Git -> Unstaged changes' window causes an error and doesn't appear to do anything - The diff still shows whichever file I looked at last in the diff.
Steps to Reproduce
Modify any file in a git submodule of the project
Try clicking that submodule (which shows in the unstaged files window)
Booboo.
Expected behavior:
To be honest I didn't know what to expect as this is the first time I've tried the new plugin. Should clicking the submodule open up a new 'unstaged files' window listing the files in that submodule? Are submodule supposed to be supported at all? I imagine in any case this error isn't expected. :)
Actual behavior:
Two of submodules only have local commits (no unstaged changes inside) and thus the diff shows for each:
Clicking the third one (has unstaged changes and no local commits) produces a console error and does nothing in the UI:
Uncaught (in promise) TypeError: Cannot read property 'old_mode' of null
at postProcessDiff ({removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\what-the-diff\lib\parser.js:1885:1)
at peg$c4 ({removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\what-the-diff\lib\parser.js:148:1)
at peg$parseregular_diff ({removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\what-the-diff\lib\parser.js:564:1)
at peg$parsediff ({removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\what-the-diff\lib\parser.js:439:1)
at peg$parsediffs ({removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\what-the-diff\lib\parser.js:403:1)
at Object.peg$parse [as parse] ({removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\what-the-diff\lib\parser.js:1933:1)
at parse ({removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\what-the-diff\index.js:6:1)
at {removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\github\lib\git-shell-out-strategy.js:637:1
at next (<anonymous>)
at step ({removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\github\lib\git-shell-out-strategy.js:103:1)
at {removed}\AppData\Local\atom\app-1.18.0-beta0\resources\app\node_modules\github\lib\git-shell-out-strategy.js:110:1
Thanks for the report! You're right that we don't yet support submodules well, but the error is unexpected. I'd like to leave this open to investigate.
Also worth noting: In the broken scenario (where the submodule has unstaged changes) - The error doesn't happen if the same submodule also has local commits. So, for each submodule:
If local changes but no local commit - error
If local changes and also local commit - shows Subproject hash diff
If no local changes but has local commit - shows Subproject hash diff
Thanks for the report! Your last comment was very helpful in diagnosing the issue 🙇♀️. We've got a quick fix up in #838. It's a less than ideal solution that will prevent exceptions until we implement more full comprehensive submodule support in the future.
Activity
BinaryMuse commentedon May 17, 2017
Thanks for the report! You're right that we don't yet support submodules well, but the error is unexpected. I'd like to leave this open to investigate.
siggirh commentedon May 17, 2017
Also worth noting: In the broken scenario (where the submodule has unstaged changes) - The error doesn't happen if the same submodule also has local commits. So, for each submodule:
If local changes but no local commit - error
If local changes and also local commit - shows Subproject hash diff
If no local changes but has local commit - shows Subproject hash diff
kuychaco commentedon May 17, 2017
Thanks for the report! Your last comment was very helpful in diagnosing the issue 🙇♀️. We've got a quick fix up in #838. It's a less than ideal solution that will prevent exceptions until we implement more full comprehensive submodule support in the future.