Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.

Fall back to .git/packed-refs if .git/<ref> does not exist#67

Closed
tsholmes wants to merge 1 commit intonpm:masterfrom
tsholmes:git_packed_refs
Closed

Fall back to .git/packed-refs if .git/<ref> does not exist#67
tsholmes wants to merge 1 commit intonpm:masterfrom
tsholmes:git_packed_refs

Conversation

@tsholmes
Copy link
Copy Markdown

When running npm publish in a repo with its refs packed, the gitHead property is not filled.

This change falls back to searching .git/packed-refs if the ref is not found in its own file under .git.

@motiz88
Copy link
Copy Markdown

motiz88 commented Aug 14, 2016

Worth mentioning: The omission of gitHead (which this PR fixes) breaks semantic-release workflows in some environments (e.g. packages published from CircleCI lack gitHead, while ones published from Travis do). It took some digging to identify this as the root cause but I'm fairly confident now. See e.g semantic-release/semantic-release#256.

So, personally, I would love for this to be merged and released ASAP, and/or for a dedicated solution like https://github.com/tricknotes/npm-git-info to be used (in lieu of taking a dependency on git itself as #66 originally suggested).

Copy link
Copy Markdown
Contributor

@zkat zkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsholmes could you add a test for this? Otherwise lgtm.

@zkat
Copy link
Copy Markdown
Contributor

zkat commented Mar 8, 2018

This was superseded by #77

@zkat zkat closed this Mar 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants