composer / composer/composer

dev-main found instead of dev-master

Open
#12,078 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
29.5k
Forks
4.8k
Avg merge
2d 2h
Merged PRs (30d)
12

Description

In 2021 there was an issue https://github.com/composer/composer/issues/10360 and the fix for this issue made an exact opposite issue for us, we have `dev-master` and now composer just found `dev-main`

My `composer.json`:

```json
{
"name": "foobar/project",
"type": "project",
"require": {
"foobar/package": "dev-master"
},
"repositories": {
"foobar/package": {
"type": "path",
"url": "/path/to/package/"
}
}
}
```

/path/to/package/composer.json
```json
{
"name": "foobar/package",
"type": "library"
}
```

Output of `composer diagnose`:

```
$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires foobar/package dev-main, found foobar/package[dev-master] but it does not match the constraint.
```

When I run this command:

```
composer update foobar/package
```

I get the following output:

```
$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires foobar/package dev-master, found foobar/package[dev-main] but it does not match the constraint.
```

And I expected this to happen:
I expect it to work fine without any errors

there was a fix [here](https://github.com/composer/composer/pull/10372/commits/714d68c0e58aa91ef595743fd43313305958fe0b) to have aliases for branches I do not know why it is removed [here](https://github.com/composer/composer/commit/2b99d069b22557cf87f3caacfb50251e3cf6c2ee) :
and when we are removing a PR changes I expect to revert everything, in the previous PR it is changed to `dev-main` and when we removed the changes we didn't move it back to `dev-master`!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.