Skip to content

followup #450: fixes behavior when "disableBranchWithChanges": true #477

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

Merged

Conversation

telamonian
Copy link
Member

followup #450

Currently, if "disableBranchWithChanges": true is in settings, branch ops are disabled completely in all cases. This PR restores the old "disable when there are changes" behavior when the setting is true

Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

@telamonian One minor change regarding conditional logic to ensure that empty arrays do not return a false positive.

Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

The most recent changes look good to me and should cover the potential cases where stagedFiles and unstagedFiles could be either

  • undefined
  • null
  • []
  • [ 'path1', 'path2', ... ]

and we only want to disable branch operations when we either have staged or unstaged files (i.e., when either unstagedFiles or stagedFiles is a non-empty Array.

@telamonian telamonian merged commit db47230 into jupyterlab:master Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants