mirror of
https://github.com/composer/composer
synced 2025-05-11 09:32:55 +00:00
Support aliases for numeric branches. Fixes #3461
This commit is contained in:
parent
2a1a963b00
commit
7bb85ff21e
8 changed files with 102 additions and 5 deletions
|
@ -251,6 +251,17 @@ class ValidatingArrayLoader implements LoaderInterface
|
|||
if ('-dev' !== substr($validatedTargetBranch, -4)) {
|
||||
$this->warnings[] = 'extra.branch-alias.'.$sourceBranch.' : the target branch ('.$targetBranch.') must be a parseable number like 2.0-dev';
|
||||
unset($this->config['extra']['branch-alias'][$sourceBranch]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// If using numeric aliases ensure the alias is a valid subversion
|
||||
if(($sourcePrefix = $this->versionParser->parseNumericAliasPrefix($sourceBranch))
|
||||
&& ($targetPrefix = $this->versionParser->parseNumericAliasPrefix($targetBranch))
|
||||
&& (stripos($targetPrefix, $sourcePrefix) !== 0)
|
||||
) {
|
||||
$this->warnings[] = 'extra.branch-alias.'.$sourceBranch.' : the target branch ('.$targetBranch.') is not a valid numeric alias for this version';
|
||||
unset($this->config['extra']['branch-alias'][$sourceBranch]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue