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

Bugfix checkouting existing branch. Fixes issue #109 #149

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

navrkald
Copy link

@navrkald navrkald commented Feb 14, 2024

Description

Fixes #109.

Original code did equivalent of following:

git clone <some repo>
git checkout -b <branch name>
git merge --ff origin/<branch name>

new code is properly checkouting remote branch if exists

git clone <some repo>
git fetch
# Try to checkout remote branch
git checkout <branch name>
# If above command fails then new branch is created
git checkout -b <branch name>

Problem with original code is not only that's not convenient, but it's as well bugy, it's silently supposing that <branch name> was created on top of default remote branch name plus it's supposing remote branch name haven't changed in meanwhile until remote <branch name> was created. Ofc this conditions are often not met and thats the case when the bug #109 appears.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes

Fixed #109 checkout remote branch locally if exists.

@navrkald
Copy link
Author

navrkald commented Apr 18, 2024

Hi @brikis98 , @hongil0316 It's been 2 months since creation of this PR. Can you please review?

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.

git-xargs doesn't update existing PRs
2 participants