crap -C is different

This commit is contained in:
Peter Cottle 2012-11-04 23:31:26 -08:00
parent 89b7e97e1d
commit 96b8356475
3 changed files with 1 additions and 15 deletions

View file

@ -535,19 +535,7 @@ GitEngine.prototype.commit = function() {
// if we want to ammend, go one above
if (this.commandOptions['--amend']) {
targetCommit = this.resolveID('HEAD~1');
// if they specify -C, go there
if (this.commandOptions['-C']) {
this.validateArgBounds(this.commandOptions['-C'], 1, 1, '-C');
targetCommit = this.numBackFrom(this.getCommitFromRef(this.commandOptions['-C'][0]), 1);
}
id = this.rebaseAltID(this.getCommitFromRef('HEAD').get('id'));
} else {
if (this.commandOptions['-C']) {
throw new GitError({
msg: 'I only support -C when doing --amend, sorry'
});
}
}
var newCommit = this.makeCommit([targetCommit], id);