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

Force change the repository to a current one #880

Merged
merged 3 commits into from
Feb 23, 2021

Conversation

ktaletsk
Copy link
Contributor

Fixes #876.

@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch ktaletsk/jupyterlab-git/sidebar-bug

@fcollonval
Copy link
Member

Thanks @ktaletsk

When testing the PR I realized that the current branch and the branch list are also affected. From the state:

      branches: [], // Affected
      currentBranch: '', // Affected
      files: [], // Not affected
      nCommitsAhead: 0,  // TBC not affected
      nCommitsBehind: 0, // TBC not affected
      pastCommits: [], // Not affected
      repository: null, // Affected
      tab: 0 // Not affected

In light of that, would it work to initialize the state in the constructor with the model values?

@ktaletsk
Copy link
Contributor Author

Hi @fcollonval, that seems to work just fine and fixes the bug. I moved repository assignment from componentDidMount to constructor and initialized current branch and the branch list from model there as well.

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thanks a lot @ktaletsk for the quick fix

@fcollonval fcollonval merged commit 8375459 into jupyterlab:master Feb 23, 2021
@fcollonval
Copy link
Member

@meeseeksdev backport to jlab-2

meeseeksmachine pushed a commit to meeseeksmachine/jupyterlab-git that referenced this pull request Feb 25, 2021
fcollonval added a commit that referenced this pull request Feb 25, 2021
…on-jlab-2

Backport PR #880 on branch jlab-2 (Force change the repository to a current one)
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.

Extension forgets it is in a git directory when moving to opposite side bar
2 participants