Resolves #769 -- updates solution commands and fixes a TON more bugs with the master to main renaming

This commit is contained in:
Peter Cottle 2021-01-01 14:20:05 -07:00
parent 592860ea10
commit a08fa94e92
22 changed files with 56 additions and 39 deletions

View file

@ -394,7 +394,7 @@ var commandConfig = {
source = firstArg;
assertIsBranch(engine.origin, source);
// get o/master locally if master is specified
destination = engine.origin.refs[source].getPrefixedID();
destination = engine.origin.resolveID(source).getPrefixedID();
}
if (source) { // empty string fails this check
assertIsRef(engine.origin, source);
@ -743,7 +743,7 @@ var commandConfig = {
var refspecParts = firstArg.split(':');
source = refspecParts[0];
destination = validateBranchName(engine, refspecParts[1]);
if (source === "" && !engine.origin.refs[destination]) {
if (source === "" && !engine.origin.resolveID(destination)) {
throw new GitError({
msg: intl.todo(
'cannot delete branch ' + options.destination + ' which doesnt exist'
@ -770,7 +770,7 @@ var commandConfig = {
sourceObj.getRemoteTrackingBranchID()) {
assertBranchIsRemoteTracking(engine, source);
var remoteBranch = sourceObj.getRemoteTrackingBranchID();
destination = engine.refs[remoteBranch].getBaseID();
destination = engine.resolveID(remoteBranch).getBaseID();
} else {
destination = validateBranchName(engine, source);
}