Skip to content

Conversation

gerhardol
Copy link
Member

Proposed changes

When refreshing a repo, an attempt is done to preserve the selection.
This detection is done by resetting the selection if the checkedout commit changes, selecting HEAD if there is one, otherwise none.
The 'unselect' was only done if the new repo had a checkedout. So no checkedout tried to select a commit that no longer exists (unless it was an artificial commit).
There was an assert especially when opening an empty repo.

Some comments:

  • The assert could be replaced with a Trace printout, the situation is handled
  • Selection could be kept if there is at least one artificial.
  • If no selection, artificial could be selected if shown.
  • As commented in the code:
            // This will assert if switching from one repo with no checkout but with a revision selected
            // to a repo also without a checkout. This is handled below.

Test methodology

Manual
I do not think a test is beneficial here.

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

Eliminate an Assert.
Add comment for an existing situation.
@ghost ghost assigned gerhardol Oct 28, 2023
@RussKie RussKie merged commit 06adb3a into gitextensions:master Oct 29, 2023
@ghost ghost added this to the vNext milestone Oct 29, 2023
@gerhardol gerhardol deleted the feature/assert-checkout-null branch October 29, 2023 07:18
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