mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38: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
|
@ -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: {},
|
||||||
|
|
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 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);
|
||||||
|
|
1
todo.txt
1
todo.txt
|
@ -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
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue