pcottle/learnGitBranching · info · CommandResult
this.getStatusMsg()
Error message
this.getStatusMsg()
What it means
Not a failure: when the working-directory/staging simulation is active (changesModelEngaged), git status returns its report by throwing a CommandResult containing this.getStatusMsg() — the per-path status lines (staged/unstaged files).
Source
Thrown at src/js/git/index.js:3093
unstaged.forEach(function(path) {
lines.push(TAB + 'modified: ' + path);
});
}
if (!staged.length && !unstaged.length) {
lines.push(intl.str('git-status-clean'));
} else if (!staged.length) {
// only unstaged changes -- git prints this reminder at the end
lines.push('');
lines.push('no changes added to commit (use "git add" and/or "git commit -a")');
}
return lines.join('\n') + '\n';
};
GitEngine.prototype.status = function() {
if (this.changesModelEngaged) {
throw new CommandResult({
msg: this.getStatusMsg()
});
}
// classic graph-only levels: keep the original playful output untouched
var lines = [];
if (this.getDetachedHead()) {
lines.push(intl.str('git-status-detached'));
} else {
var branchName = this.resolveNameNoPrefix('HEAD');
lines.push(intl.str('git-status-onbranch', {branch: branchName}));
}
lines.push('Changes to be committed:');
lines.push('');
lines.push(TAB + 'modified: cal/OskiCostume.stl');
lines.push('');
lines.push(intl.str('git-status-readytocommit'));
View on GitHub (pinned to 5b09d0ff96)
Solutions
- No fix needed
- Catch CommandResult and render/capture msg
Defensive patterns
Strategy: try-catch
Try / catch
try { engine.status(); } catch (e) { if (e instanceof CommandResult) { display(e.msg); } else throw e; } Prevention
- Catch CommandResult for read-only command output
When it happens
Trigger: Running git status in a level that engages the changes model (working directory + index simulation).
Common situations: Levels/exercises with file staging; expected informational output.
Related errors
- msg
- git-error-staging
- git-status-nothing-staged
- <dynamic describe output: foundTag>
- <dynamic describe output: foundTag-N-g<id>>
AI-assisted analysis of pcottle/learnGitBranching@5b09d0ff96 (2026-08-27).
Data as JSON: /api/errors/fc2182e11a8a22ec.
Report an issue: GitHub.