Repository navigation
put history view into the correct state after a successful pull - #3541
Merged
Merged
Conversation
iAmWillShepherd
suggested changes
Dec 8, 2017
iAmWillShepherd
left a comment
Contributor
There was a problem hiding this comment.
We will be moving away from relying on JS truthiness in conditional statements - #3538
|
|
||
| if (state.branchesState.tip.kind === TipState.Unborn) { | ||
| if (tip.kind === TipState.Unborn) { | ||
| throw new Error('The current branch is unborn.') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * after a pull has completed, to include merged remote commits. | ||
| */ | ||
| public async reconcileHistory(mergeBase: string): Promise<void> { | ||
| if (this._history.length === 0) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const commits = await this.performFailableOperation(() => | ||
| getCommits(this.repository, `HEAD..${mergeBase}`, CommitBatchSize) | ||
| ) | ||
| if (!commits) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Member
Author
|
🍎 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2737
The problem manifests itself in a couple of ways:
Because of how
loadHistorymerges new commits with the current history, you can find yourself in a situation where remote commits (which occurred before the tip of the current history) are not loaded into this array of commits.desktop/app/src/lib/stores/git-store.ts
Lines 156 to 171 in f12ff8c
The quick fix for this is to nuke the history and let it reload, but results in a flicker when you are viewing the list. This is also probably bad for scenarios where you've scrolled down the history.
The better fix for this is to reconcile the two histories manually. Given the remote ref and local branch should share a common ancestor, we should be able to invalidate a subset of the commits currently loaded:
This also means that an existing selected commit is remembered, even after moving the history around.