mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
quick implementation of git status
This commit is contained in:
parent
b944a23790
commit
51a92227c3
4 changed files with 30 additions and 1 deletions
24
src/git.js
24
src/git.js
|
@ -1091,6 +1091,30 @@ GitEngine.prototype.show = function(ref) {
|
|||
});
|
||||
};
|
||||
|
||||
GitEngine.prototype.statusStarter = function() {
|
||||
var lines = [];
|
||||
if (this.getDetachedHead()) {
|
||||
lines.push('Detached Head!');
|
||||
} else {
|
||||
var branchName = this.HEAD.get('target').get('id');
|
||||
lines.push('On branch ' + branchName);
|
||||
}
|
||||
lines.push('Changes to be committed:');
|
||||
lines.push('');
|
||||
lines.push(' modified: cal/OskiCostume.stl');
|
||||
lines.push('');
|
||||
lines.push('Ready to commit! (as always in this demo)');
|
||||
|
||||
var msg = '';
|
||||
_.each(lines, function(line) {
|
||||
msg += '# ' + line + '\n';
|
||||
});
|
||||
|
||||
throw new CommandResult({
|
||||
msg: msg
|
||||
});
|
||||
};
|
||||
|
||||
GitEngine.prototype.logStarter = function() {
|
||||
if (this.generalArgs.length > 1) {
|
||||
throw new GitError({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue