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

Fix remote history check - check if git fetch needs to be run #685

Merged

Conversation

tommy-mitchell
Copy link
Collaborator

@tommy-mitchell tommy-mitchell commented Apr 5, 2023

Fixes #421.
Fixes #414.

If np detects that there are unfetched upstream changes (via git fetch --dry-run), errors with

Remote history differs. Please run `git fetch` and pull changes.

I'm not sure if it matters that it only checks origin. I guess if the remote name differs? Should the check be git fetch @{u} --dry-run?

According to the man page, origin can be omitted:

When no remote is specified, by default the origin remote will be used, unless there’s an upstream branch configured for the current branch.

@tommy-mitchell
Copy link
Collaborator Author

The tests pass locally, but I think it may be an issue with the execa stub. I'm still figuring it out.

@sindresorhus sindresorhus merged commit a5d4c3d into sindresorhus:main Apr 6, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants