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

Try checkout the default branch if the current branch is deleted #359

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

draftcode
Copy link
Contributor

@draftcode draftcode commented Jul 10, 2024

This is a continuation of #357. There are people who prefers checkout
the default branch if the current branch is deleted after av stack sync.
All things considered, change the behavior like this. After av stack
sync:

  1. If the originally checked out branch still exists, check it out.
  2. If the originally checked out branch is deleted, check out the
    default branch if it exists.
  3. If the default branch doesn't exist, check out the remote tracking
    branch of the default branch if it exists. (It should exist at this
    point usually.)
  4. Otherwise, do nothing.

This should satisfy all the parties.

Copy link
Contributor

aviator-app bot commented Jul 10, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

Copy link
Contributor

aviator-app bot commented Jul 10, 2024

FlexReview Summary

Based on the code complexity and the author's expertise score, these are the suggested reviewers:

  • @jainankit (current review load: 0)

See the list of alternate reviewers in the detailed breakdown below.

Detailed Breakdown Author’s expertise score for the modified files:
  • internal/git/gitui/prune.go (1.00)
Files Reviewers
internal/git/gitui/prune.go @jainankit (score: 0.69, current review load: 0)

† Indicates that the file doesn't need an expert review. (?)

See full breakdown of the reviewers on the Aviator webapp.

@aviator-app aviator-app bot requested a review from jainankit July 10, 2024 01:44
This is a continuation of #357. There are people who prefers checkout
the default branch if the current branch is deleted after av stack sync.
All things considered, change the behavior like this. After av stack
sync:

1. If the originally checked out branch still exists, check it out.
2. If the originally checked out branch is deleted, check out the
   default branch if it exists.
3. If the default branch doesn't exist, check out the remote tracking
   branch of the default branch if it exists. (It should exist at this
   point usually.)
4. Otherwise, do nothing.

This should satisfy all the parties.
@draftcode draftcode force-pushed the checkout_conditionally branch from 4ed84a0 to 021db51 Compare July 10, 2024 01:50
@aviator-app aviator-app bot merged commit d74f1e1 into master Jul 10, 2024
4 checks passed
@aviator-app aviator-app bot deleted the checkout_conditionally branch July 10, 2024 01:53
draftcode added a commit that referenced this pull request Jul 22, 2024
This is a follow-up of #359. The PR
didn't work as expected. Write a test and verify the behavior.
aviator-app bot pushed a commit that referenced this pull request Jul 26, 2024
This is a follow-up of #359. The PR
didn't work as expected. Write a test and verify the behavior.
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.

2 participants