Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNPM Git Resolver: Incorrect Branch Installation #7603

Closed
2 of 4 tasks
datrhi opened this issue Feb 1, 2024 · 0 comments · Fixed by #7609 or pnpm/hosted-git-info#3
Closed
2 of 4 tasks

PNPM Git Resolver: Incorrect Branch Installation #7603

datrhi opened this issue Feb 1, 2024 · 0 comments · Fixed by #7609 or pnpm/hosted-git-info#3

Comments

@datrhi
Copy link
Contributor

datrhi commented Feb 1, 2024

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

8.15.1

Which area(s) of pnpm are affected? (leave empty if unsure)

Dependencies resolver, CLI

Link to the code that reproduces this issue or a replay of the bug

https://github.com/datrhi/pnpm-git-resolve-bug

Reproduction steps

  1. Clone the Repository:
  1. PNPM Install:
  • pnpm install

Describe the Bug

PNPM Git Resolver Issue: Incorrect Branch Installation

When specifying a Git dependency in package.json, PNPM unexpectedly installs the master branch instead of the explicitly declared empty branch. This behavior contrasts with Yarn, which accurately installs the specified empty branch for the react-native-camera-kit dependency. This inconsistency in PNPM's interpretation of Git URLs compared to Yarn can lead to potential confusion and errors in dependency management.

Understanding the Issue

The package.json declaration for installing a Git dependency is as follows:

"dependencies": {
  "react-native-camera-kit": "git+https://gitlab.com/dung.huynh1/react-native-camera-kit.git#empty"
}

This line instructs the package manager to clone the react-native-camera-kit repository from the specified GitLab URL, specifically targeting the empty branch. While Yarn follows this directive accurately, PNPM diverges by defaulting to the repository's main branch (commonly master), ignoring the branch specifier in the URL.

Expected Behavior

Installing the Exact Version of a Dependency

Which Node.js version are you using?

14.21.3

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

@datrhi datrhi changed the title Resolution of Git URLs contain branch is wrong PNPM Git Resolver: Incorrect Branch Installation Feb 1, 2024
zkochan pushed a commit that referenced this issue Feb 6, 2024
zkochan pushed a commit that referenced this issue Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant