mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 07:58:34 +02:00
Change fetch arguments up a bit, start migrating
This commit is contained in:
parent
e5b4ac5b1c
commit
7225e9b7e6
3 changed files with 15 additions and 6 deletions
|
@ -265,8 +265,20 @@ var commandConfig = {
|
|||
command.twoArgsImpliedOrigin(generalArgs);
|
||||
assertOriginSpecified(generalArgs);
|
||||
|
||||
if (generalArgs[1]) {
|
||||
var tracking = assertBranchIsRemoteTracking(engine, generalArgs[1]);
|
||||
var firstArg = generalArgs[1];
|
||||
if (firstArg && isColonRefspec(firstArg)) {
|
||||
var refspecParts = firstArg.split(':');
|
||||
options.source = refspecParts[0];
|
||||
options.destination = refspecParts[1];
|
||||
|
||||
// destination will be created by fetch, but check source
|
||||
assertIsRef(engine.origin, options.source);
|
||||
} else if (firstArg) {
|
||||
// here is the deal -- its JUST like git push. the first arg
|
||||
// is used as both the destination and the source, so we need
|
||||
// to make sure it exists as the source on REMOTE and then
|
||||
// the destination will be created locally
|
||||
var tracking = assertBranchIsRemoteTracking(engine, firstArg);
|
||||
options.branches = [engine.refs[tracking]];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue