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: support all git versions for wrangler init #1265

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

petebacondarwin
Copy link
Contributor

@petebacondarwin petebacondarwin commented Jun 15, 2022

If git does not support the --initial-branch argument then just fallback to the default initial branch name.

We tried to be more clever about this but there are two many weird corner cases with different git versions on different architectures.
Now we do our best, with recent versions of git, to ensure that the branch is called main but otherwise just make sure we don't crash.

Fixes #1228

@changeset-bot
Copy link

changeset-bot bot commented Jun 15, 2022

🦋 Changeset detected

Latest commit: 5ac7704

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jun 15, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2528900878/npm-package-wrangler-1265

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1265/npm-package-wrangler-1265

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2528900878/npm-package-wrangler-1265 dev path/to/script.js

@petebacondarwin petebacondarwin force-pushed the git-init-2 branch 2 times, most recently from b377829 to 60a720b Compare June 20, 2022 11:21
If `git` does not support the `--initial-branch` argument then just fallback to the default initial branch name.

We tried to be more clever about this but there are two many weird corner cases with different git versions on different architectures.
Now we do our best, with recent versions of git, to ensure that the branch is called `main` but otherwise just make sure we don't crash.

Fixes cloudflare#1228
@petebacondarwin petebacondarwin changed the title fix: ensure git branch rename works on all git versions for wrangler init fix: support all git versions for wrangler init Jun 20, 2022
@threepointone threepointone merged commit e322475 into cloudflare:main Jun 20, 2022
@github-actions github-actions bot mentioned this pull request Jun 20, 2022
@petebacondarwin petebacondarwin deleted the git-init-2 branch June 20, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Initializing project with git fails
3 participants