mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
crap -C is different
This commit is contained in:
parent
89b7e97e1d
commit
96b8356475
3 changed files with 1 additions and 15 deletions
12
src/git.js
12
src/git.js
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue