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

@ -282,8 +282,7 @@ OptionParser.prototype.getMasterOptionMap = function() {
'--amend': false, '--amend': false,
'-a': false, // warning '-a': false, // warning
'-am': false, // warning '-am': false, // warning
'-m': false, '-m': false
'-C': false
}, },
status: {}, status: {},
log: {}, log: {},

View file

@ -535,19 +535,7 @@ GitEngine.prototype.commit = function() {
// if we want to ammend, go one above // if we want to ammend, go one above
if (this.commandOptions['--amend']) { if (this.commandOptions['--amend']) {
targetCommit = this.resolveID('HEAD~1'); 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')); 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); var newCommit = this.makeCommit([targetCommit], id);

View file

@ -35,7 +35,6 @@ Pre-publish things:
extra command ideas: extra command ideas:
git log branchA ^branchB git log branchA ^branchB
git commit --amend -C HEAD
2013 Things 2013 Things
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~