Merge branch 'development' into feature/add-fork-setting

This commit is contained in:
Rafael Oleza 2020-05-22 17:08:28 +02:00
commit 55e400c755
29 changed files with 163 additions and 329 deletions

View file

@ -3,7 +3,7 @@
"productName": "GitHub Desktop",
"bundleID": "com.github.GitHubClient",
"companyName": "GitHub, Inc.",
"version": "2.4.4-beta4",
"version": "2.5.1-beta1",
"main": "./main.js",
"repository": {
"type": "git",

View file

@ -41,79 +41,11 @@ export function enableReadmeOverwriteWarning(): boolean {
return enableBetaFeatures()
}
/** Should the app automatically prune branches that are no longer actively being used */
export function enableBranchPruning(): boolean {
return true
}
/**
* Whether or not to activate the "Create PR" blankslate action.
*
* The state of the feature as of writing this is that the underlying
* data source required to power this feature is not reliable enough
* and needs looking at so we aren't ready to move this to production
* just yet.
*/
export function enableNoChangesCreatePRBlankslateAction(): boolean {
return true
}
/**
* Enables a new UI for the repository picker that supports
* grouping and filtering (GitHub) repositories by owner/organization.
*/
export function enableGroupRepositoriesByOwner(): boolean {
return true
}
/** Should the app show the "rebase current branch" dialog? */
export function enableRebaseDialog(): boolean {
return true
}
/** Should the app show the "stash changes" dialog? */
export function enableStashing(): boolean {
return true
}
/**
* Should the application query for branch protection information and store this
* to help the maintainers understand how broadly branch protections are
* encountered?
*/
export function enableBranchProtectionChecks(): boolean {
return true
}
/** Should the app detect Windows Subsystem for Linux as a valid shell? */
export function enableWSLDetection(): boolean {
return enableBetaFeatures()
}
/**
* Should the application warn the user when they are about to commit to a
* protected branch, and encourage them into a flow to move their changes to
* a new branch?
*
* As this builds upon existing branch protection features in the codebase, this
* flag is linked to to `enableBranchProtectionChecks()`.
*/
export function enableBranchProtectionWarningFlow(): boolean {
return true
}
export function enableHideWhitespaceInDiffOption(): boolean {
return true
}
/**
* Should we enable the onboarding tutorial. This includes the initial
* configuration of the tutorial repo as well as the tutorial itself.
*/
export function enableTutorial(): boolean {
return true
}
/**
* Should we show the create fork dialog flow?
*/
@ -169,7 +101,7 @@ export function enableForkyCreateBranchUI(): boolean {
* are new commits upstream.)
*/
export function enableNDDBBanner(): boolean {
return enableBetaFeatures()
return false
}
/**

View file

@ -84,6 +84,7 @@ export async function fetchTagsToPush(
branchName,
'--follow-tags',
'--dry-run',
'--no-verify',
'--porcelain',
]

View file

@ -10,7 +10,7 @@ type IndexLookup = {
/**
* The names of any env vars that we shouldn't copy from the shell environment.
*/
const BlacklistedNames = new Set(['LOCAL_GIT_DIRECTORY'])
const ExcludedEnvironmentVars = new Set(['LOCAL_GIT_DIRECTORY'])
/**
* Inspect whether the current process needs to be patched to get important
@ -152,7 +152,7 @@ async function getEnvironmentFromShell(
*/
function mergeEnvironmentVariables(env: IndexLookup) {
for (const key in env) {
if (BlacklistedNames.has(key)) {
if (ExcludedEnvironmentVars.has(key)) {
continue
}

View file

@ -80,7 +80,6 @@ import {
getAccountForEndpoint,
getDotComAPIEndpoint,
IAPIOrganization,
IAPIBranch,
IAPIRepository,
getEndpointForRepository,
} from '../api'
@ -225,15 +224,7 @@ import {
ManualConflictResolutionKind,
} from '../../models/manual-conflict-resolution'
import { BranchPruner } from './helpers/branch-pruner'
import {
enableBranchPruning,
enableGroupRepositoriesByOwner,
enableStashing,
enableBranchProtectionChecks,
enableBranchProtectionWarningFlow,
enableHideWhitespaceInDiffOption,
enableUpdateRemoteUrl,
} from '../feature-flag'
import { enableUpdateRemoteUrl } from '../feature-flag'
import { Banner, BannerType } from '../../models/banner'
import * as moment from 'moment'
import { isDarkModeEnabled } from '../../ui/lib/dark-theme'
@ -859,10 +850,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
}
private async refreshBranchProtectionState(repository: Repository) {
if (!enableBranchProtectionWarningFlow()) {
return
}
const gitStore = this.gitStoreCache.get(repository)
if (
@ -1438,7 +1425,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
repository,
file,
sha,
enableHideWhitespaceInDiffOption() ? this.hideWhitespaceInDiff : false
this.hideWhitespaceInDiff
)
const stateAfterLoad = this.repositoryStateCache.get(repository)
@ -1502,9 +1489,8 @@ export class AppStore extends TypedBaseStore<IAppState> {
const previousRepositoryId = previouslySelectedRepository
? previouslySelectedRepository.id
: null
if (enableGroupRepositoriesByOwner()) {
this.updateRecentRepositories(previousRepositoryId, repository.id)
}
this.updateRecentRepositories(previousRepositoryId, repository.id)
// if repository might be marked missing, try checking if it has been restored
const refreshedRepository = await this.recoverMissingRepository(repository)
@ -1607,17 +1593,15 @@ export class AppStore extends TypedBaseStore<IAppState> {
return
}
if (enableBranchPruning()) {
const pruner = new BranchPruner(
repository,
this.gitStoreCache,
this.repositoriesStore,
this.repositoryStateCache,
repository => this._refreshRepository(repository)
)
this.currentBranchPruner = pruner
this.currentBranchPruner.start()
}
const pruner = new BranchPruner(
repository,
this.gitStoreCache,
this.repositoriesStore,
this.repositoryStateCache,
repository => this._refreshRepository(repository)
)
this.currentBranchPruner = pruner
this.currentBranchPruner.start()
}
public async _refreshIssues(repository: GitHubRepository) {
@ -2569,26 +2553,24 @@ export class AppStore extends TypedBaseStore<IAppState> {
}
}
if (enableBranchProtectionChecks()) {
const branchProtectionsFound = await this.repositoriesStore.hasBranchProtectionsConfigured(
repository.gitHubRepository
)
const branchProtectionsFound = await this.repositoriesStore.hasBranchProtectionsConfigured(
repository.gitHubRepository
)
if (branchProtectionsFound) {
this.statsStore.recordCommitToRepositoryWithBranchProtections()
}
if (branchProtectionsFound) {
this.statsStore.recordCommitToRepositoryWithBranchProtections()
}
const branchName = findRemoteBranchName(
gitStore.tip,
gitStore.currentRemote,
repository.gitHubRepository
)
const branchName = findRemoteBranchName(
gitStore.tip,
gitStore.currentRemote,
repository.gitHubRepository
)
if (branchName !== null) {
const { changesState } = this.repositoryStateCache.get(repository)
if (changesState.currentBranchProtected) {
this.statsStore.recordCommitToProtectedBranch()
}
if (branchName !== null) {
const { changesState } = this.repositoryStateCache.get(repository)
if (changesState.currentBranchProtected) {
this.statsStore.recordCommitToProtectedBranch()
}
}
@ -3052,7 +3034,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
const hasChanges = changesState.workingDirectory.files.length > 0
if (
enableStashing() &&
hasChanges &&
currentBranch !== null &&
uncommittedChangesStrategy.kind ===
@ -3131,24 +3112,23 @@ export class AppStore extends TypedBaseStore<IAppState> {
)
let stashToPop: IStashEntry | null = null
if (enableStashing()) {
const hasChanges = changesState.workingDirectory.files.length > 0
if (hasChanges) {
if (uncommittedChangesStrategy.kind === askToStash.kind) {
this._showPopup({
type: PopupType.StashAndSwitchBranch,
branchToCheckout: branch,
repository,
})
return repository
}
stashToPop = await this.stashToPopAfterBranchCheckout(
const hasChanges = changesState.workingDirectory.files.length > 0
if (hasChanges) {
if (uncommittedChangesStrategy.kind === askToStash.kind) {
this._showPopup({
type: PopupType.StashAndSwitchBranch,
branchToCheckout: branch,
repository,
branch,
uncommittedChangesStrategy
)
})
return repository
}
stashToPop = await this.stashToPopAfterBranchCheckout(
repository,
branch,
uncommittedChangesStrategy
)
}
const checkoutSucceeded =
@ -3178,7 +3158,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
}
if (
enableStashing() &&
uncommittedChangesStrategy.kind ===
UncommittedChangesStrategyKind.MoveToNewBranch &&
checkoutSucceeded
@ -3413,9 +3392,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
const api = API.fromAccount(account)
const branches = enableBranchProtectionChecks()
? await api.fetchProtectedBranches(owner.login, name)
: new Array<IAPIBranch>()
const branches = await api.fetchProtectedBranches(owner.login, name)
await this.repositoriesStore.updateBranchProtections(
repository.gitHubRepository,
@ -5554,10 +5531,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
repository: Repository,
branchName: string
) {
if (!enableStashing()) {
return
}
const previousStashEntry = await getLastDesktopStashEntryForBranch(
repository,
branchName
@ -5588,10 +5561,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
repository: Repository,
branchToCheckout: Branch
) {
if (!enableStashing()) {
return
}
const {
changesState: { workingDirectory },
} = this.repositoryStateCache.get(repository)
@ -5621,9 +5590,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
/** This shouldn't be called directly. See `Dispatcher`. */
public async _popStashEntry(repository: Repository, stashEntry: IStashEntry) {
if (!enableStashing()) {
return
}
const gitStore = this.gitStoreCache.get(repository)
await gitStore.performFailableOperation(() => {
return popStashEntry(repository, stashEntry.stashSha)
@ -5643,9 +5609,6 @@ export class AppStore extends TypedBaseStore<IAppState> {
repository: Repository,
stashEntry: IStashEntry
) {
if (!enableStashing()) {
return
}
const gitStore = this.gitStoreCache.get(repository)
await gitStore.performFailableOperation(() => {
return dropDesktopStashEntry(repository, stashEntry.stashSha)

View file

@ -81,7 +81,6 @@ import { formatCommitMessage } from '../format-commit-message'
import { GitAuthor } from '../../models/git-author'
import { IGitAccount } from '../../models/git-account'
import { BaseStore } from './base-store'
import { enableStashing } from '../feature-flag'
import { getStashes, getStashedFiles } from '../git/stash'
import { IStashEntry, StashedChangesLoadStates } from '../../models/stash-entry'
import { PullRequest } from '../../models/pull-request'
@ -265,7 +264,15 @@ export class GitStore extends BaseStore {
public async refreshTags() {
const previousTags = this._localTags
this._localTags = await getAllTags(this.repository)
const newTags = await this.performFailableOperation(() =>
getAllTags(this.repository)
)
if (newTags === undefined) {
return
}
this._localTags = newTags
if (previousTags !== null) {
// We don't await for the emition of updates to finish
@ -1095,10 +1102,6 @@ export class GitStore extends BaseStore {
* Refreshes the list of GitHub Desktop created stash entries for the repository
*/
public async loadStashEntries(): Promise<void> {
if (!enableStashing()) {
return
}
const map = new Map<string, IStashEntry>()
const stash = await getStashes(this.repository)
@ -1150,10 +1153,6 @@ export class GitStore extends BaseStore {
* Updates the latest stash entry with a list of files that it changes
*/
private async loadFilesForCurrentStashEntry() {
if (!enableStashing()) {
return
}
const stashEntry = this.currentBranchStashEntry
if (

View file

@ -13,7 +13,6 @@ import { Repository } from '../../models/repository'
import { fatalError } from '../fatal-error'
import { IAPIRepository, IAPIBranch, IAPIRepositoryPermissions } from '../api'
import { TypedBaseStore } from './base-store'
import { enableBranchProtectionChecks } from '../feature-flag'
/** The store for local repositories. */
export class RepositoriesStore extends TypedBaseStore<
@ -493,10 +492,6 @@ export class RepositoriesStore extends TypedBaseStore<
gitHubRepository: GitHubRepository,
protectedBranches: ReadonlyArray<IAPIBranch>
): Promise<void> {
if (!enableBranchProtectionChecks()) {
return
}
const dbID = gitHubRepository.dbID
if (!dbID) {
return fatalError(

View file

@ -5,11 +5,7 @@ import { truncateWithEllipsis } from '../../lib/truncate-with-ellipsis'
import { getLogDirectoryPath } from '../../lib/logging/get-log-path'
import { ensureDir } from 'fs-extra'
import { openDirectorySafe } from '../shell'
import {
enableRebaseDialog,
enableStashing,
enableCreateGitHubIssueFromMenu,
} from '../../lib/feature-flag'
import { enableCreateGitHubIssueFromMenu } from '../../lib/feature-flag'
import { MenuLabelsEvent } from '../../models/menu-labels'
import { DefaultEditorLabel } from '../../ui/lib/context-menu'
@ -212,7 +208,6 @@ export function buildDefaultMenu({
click: isStashedChangesVisible
? emit('hide-stashed-changes')
: emit('show-stashed-changes'),
visible: enableStashing(),
},
{
label: __DARWIN__ ? 'Toggle Full Screen' : 'Toggle &full screen',
@ -403,7 +398,6 @@ export function buildDefaultMenu({
id: 'rebase-branch',
accelerator: 'CmdOrCtrl+Shift+E',
click: emit('rebase-branch'),
visible: enableRebaseDialog(),
},
separator,
{

View file

@ -2,7 +2,6 @@ import * as Path from 'path'
import { GitHubRepository } from './github-repository'
import { IAheadBehind } from './branch'
import { enableTutorial } from '../lib/feature-flag'
import { WorkflowPreferences } from './workflow-preferences'
function getBaseName(path: string): string {
@ -69,7 +68,7 @@ export class Repository {
* of Git and GitHub.
*/
public get isTutorialRepository() {
return enableTutorial() && this._isTutorialRepository === true
return this._isTutorialRepository === true
}
}

View file

@ -104,7 +104,7 @@ import { StashAndSwitchBranch } from './stash-changes/stash-and-switch-branch-di
import { OverwriteStash } from './stash-changes/overwrite-stashed-changes-dialog'
import { ConfirmDiscardStashDialog } from './stashing/confirm-discard-stash'
import { CreateTutorialRepositoryDialog } from './no-repositories/create-tutorial-repository-dialog'
import { enableTutorial, enableForkyCreateBranchUI } from '../lib/feature-flag'
import { enableForkyCreateBranchUI } from '../lib/feature-flag'
import { ConfirmExitTutorial } from './tutorial'
import { TutorialStep, isValidTutorialStep } from '../models/tutorial-step'
import { WorkflowPushRejectedDialog } from './workflow-push-rejected/workflow-push-rejected'
@ -698,10 +698,6 @@ export class App extends React.Component<IAppProps, IAppState> {
}
private showCreateTutorialRepositoryPopup = () => {
if (!enableTutorial()) {
return
}
const account = this.getDotComAccount() || this.getEnterpriseAccount()
if (account === null) {
@ -731,9 +727,7 @@ export class App extends React.Component<IAppProps, IAppState> {
: null
const isTutorialRepository =
enableTutorial() &&
selectedRepository &&
selectedRepository.isTutorialRepository
selectedRepository && selectedRepository.isTutorialRepository
return isTutorialRepository ? selectedRepository : null
}

View file

@ -34,7 +34,6 @@ import { basename } from 'path'
import { ICommitContext } from '../../models/commit'
import { RebaseConflictState } from '../../lib/app-state'
import { ContinueRebase } from './continue-rebase'
import { enableStashing } from '../../lib/feature-flag'
import { Octicon, OcticonSymbol } from '../octicons'
import { IStashEntry } from '../../models/stash-entry'
import * as classNames from 'classnames'
@ -662,9 +661,6 @@ export class ChangesList extends React.Component<
}
private renderStashedChanges() {
if (!enableStashing()) {
return null
}
if (this.props.stashEntry === null) {
return null
}

View file

@ -27,7 +27,6 @@ import { IMenuItem } from '../../lib/menu-item'
import { ICommitContext } from '../../models/commit'
import { startTimer } from '../lib/timing'
import { PermissionsCommitWarning } from './permissions-commit-warning'
import { enableBranchProtectionWarningFlow } from '../../lib/feature-flag'
import { LinkButton } from '../lib/link-button'
import { FoldoutType } from '../../lib/app-state'
@ -454,10 +453,6 @@ export class CommitMessage extends React.Component<
}
private renderPermissionsCommitWarning = (branch: string) => {
if (!enableBranchProtectionWarningFlow()) {
return null
}
const { showBranchProtected, showNoWriteAccess, repository } = this.props
if (showNoWriteAccess) {

View file

@ -3,10 +3,6 @@ import * as React from 'react'
import { encodePathAsUrl } from '../../lib/path'
import { Repository } from '../../models/repository'
import { LinkButton } from '../lib/link-button'
import {
enableNoChangesCreatePRBlankslateAction,
enableStashing,
} from '../../lib/feature-flag'
import { MenuIDs } from '../../models/menu-ids'
import { IMenu, MenuItem } from '../../models/app-menu'
import memoizeOne from 'memoize-one'
@ -359,25 +355,19 @@ export class NoChanges extends React.Component<
return this.renderPushBranchAction(tip, remote, aheadBehind, tagsToPush)
}
if (enableNoChangesCreatePRBlankslateAction()) {
const isGitHub = this.props.repository.gitHubRepository !== null
const hasOpenPullRequest = currentPullRequest !== null
const isDefaultBranch =
defaultBranch !== null && tip.branch.name === defaultBranch.name
const isGitHub = this.props.repository.gitHubRepository !== null
const hasOpenPullRequest = currentPullRequest !== null
const isDefaultBranch =
defaultBranch !== null && tip.branch.name === defaultBranch.name
if (isGitHub && !hasOpenPullRequest && !isDefaultBranch) {
return this.renderCreatePullRequestAction(tip)
}
if (isGitHub && !hasOpenPullRequest && !isDefaultBranch) {
return this.renderCreatePullRequestAction(tip)
}
return null
}
private renderViewStashAction() {
if (!enableStashing()) {
return null
}
const { changesState, branchesState } = this.props.repositoryState
const { tip } = branchesState

View file

@ -188,7 +188,10 @@ export async function gitAuthenticationErrorHandler(
return null
}
/** Handle git clone errors to give chance to retry error. */
/**
* Handle git clone errors to give chance to retry error.
* Doesn't handle auth errors.
*/
export async function gitCloneErrorHandler(
error: Error,
dispatcher: Dispatcher
@ -207,6 +210,12 @@ export async function gitCloneErrorHandler(
return error
}
const dugiteError = gitError.result.gitError
// don't catch this if this its an auth error
if (dugiteError !== null && AuthenticationErrors.has(dugiteError)) {
return error
}
const repository = e.metadata.repository
if (!repository) {
return error

View file

@ -89,15 +89,30 @@ export class CommitListItem extends React.PureComponent<
</div>
</div>
</div>
<div className="commit-indicators">
{enableGitTagsDisplay() &&
renderCommitListItemTags(this.props.commit.tags)}
{this.renderUnpushedIndicator()}
</div>
{this.renderCommitIndicators()}
</div>
)
}
private renderCommitIndicators() {
const tagIndicator = enableGitTagsDisplay()
? renderCommitListItemTags(this.props.commit.tags)
: null
const unpushedIndicator = this.renderUnpushedIndicator()
if (tagIndicator || unpushedIndicator) {
return (
<div className="commit-indicators">
{tagIndicator}
{unpushedIndicator}
</div>
)
}
return null
}
private renderUnpushedIndicator() {
if (!this.props.showUnpushedIndicator) {
return null

View file

@ -11,10 +11,7 @@ import { getAvatarUsersForCommit, IAvatarUser } from '../../models/avatar'
import { AvatarStack } from '../lib/avatar-stack'
import { CommitAttribution } from '../lib/commit-attribution'
import { Checkbox, CheckboxValue } from '../lib/checkbox'
import {
enableHideWhitespaceInDiffOption,
enableGitTagsDisplay,
} from '../../lib/feature-flag'
import { enableGitTagsDisplay } from '../../lib/feature-flag'
interface ICommitSummaryProps {
readonly repository: Repository
@ -360,22 +357,20 @@ export class CommitSummary extends React.Component<
</li>
{this.renderTags()}
{enableHideWhitespaceInDiffOption() && (
<li
className="commit-summary-meta-item without-truncation"
title={filesDescription}
>
<Checkbox
label="Hide Whitespace"
value={
this.props.hideWhitespaceInDiff
? CheckboxValue.On
: CheckboxValue.Off
}
onChange={this.onHideWhitespaceInDiffChanged}
/>
</li>
)}
<li
className="commit-summary-meta-item without-truncation"
title={filesDescription}
>
<Checkbox
label="Hide Whitespace"
value={
this.props.hideWhitespaceInDiff
? CheckboxValue.On
: CheckboxValue.Off
}
onChange={this.onHideWhitespaceInDiffChanged}
/>
</li>
</ul>
</div>

View file

@ -4,6 +4,8 @@ import * as React from 'react'
import * as ReactDOM from 'react-dom'
import * as Path from 'path'
import * as moment from 'moment'
import { ipcRenderer, remote } from 'electron'
import { App } from './app'
@ -86,6 +88,11 @@ process.env['LOCAL_GIT_DIRECTORY'] = Path.resolve(__dirname, 'git')
// Focus Ring! -- A11ycasts #16: https://youtu.be/ilj2P5-5CjI
require('wicg-focus-ring')
// setup this moment.js plugin so we can use easier
// syntax for formatting time duration
const momentDurationFormatSetup = require('moment-duration-format')
momentDurationFormatSetup(moment)
const startTime = performance.now()
if (!process.env.TEST_ENV) {
@ -277,6 +284,7 @@ const dispatcher = new Dispatcher(
)
dispatcher.registerErrorHandler(defaultErrorHandler)
dispatcher.registerErrorHandler(gitCloneErrorHandler)
dispatcher.registerErrorHandler(upstreamAlreadyExistsHandler)
dispatcher.registerErrorHandler(externalEditorErrorHandler)
dispatcher.registerErrorHandler(openShellErrorHandler)
@ -292,7 +300,6 @@ dispatcher.registerErrorHandler(missingRepositoryHandler)
dispatcher.registerErrorHandler(localChangesOverwrittenHandler)
dispatcher.registerErrorHandler(rebaseConflictsHandler)
dispatcher.registerErrorHandler(refusedWorkflowUpdate)
dispatcher.registerErrorHandler(gitCloneErrorHandler)
document.body.classList.add(`platform-${process.platform}`)

View file

@ -13,7 +13,6 @@ import { CloneableRepositoryFilterList } from '../clone-repository/cloneable-rep
import { IAPIRepository } from '../../lib/api'
import { assertNever } from '../../lib/fatal-error'
import { ClickSource } from '../lib/list'
import { enableTutorial } from '../../lib/feature-flag'
interface INoRepositoriesProps {
/** A function to call when the user chooses to create a repository. */
@ -357,10 +356,6 @@ export class NoRepositoriesView extends React.Component<
}
private renderTutorialRepositoryButton() {
if (!enableTutorial()) {
return null
}
// No tutorial if you're not signed in.
if (
this.props.dotComAccount === null &&

View file

@ -1,9 +1,5 @@
import * as React from 'react'
import * as moment from 'moment'
const momentDurationFormatSetup = require('moment-duration-format')
// setup moment plugin
momentDurationFormatSetup(moment)
interface IRelativeTimeProps {
/**

View file

@ -8,7 +8,6 @@ import { getDotComAPIEndpoint } from '../../lib/api'
import { caseInsensitiveCompare } from '../../lib/compare'
import { IFilterListGroup, IFilterListItem } from '../lib/filter-list'
import { IAheadBehind } from '../../models/branch'
import { enableGroupRepositoriesByOwner } from '../../lib/feature-flag'
/**
* Special, reserved repository group names
@ -52,12 +51,8 @@ export function groupRepositories(
let group: RepositoryGroupIdentifier = KnownRepositoryGroup.NonGitHub
if (gitHubRepository) {
if (gitHubRepository.endpoint === getDotComAPIEndpoint()) {
if (enableGroupRepositoriesByOwner()) {
group = gitHubRepository.owner.login
gitHubOwners.add(group)
} else {
group = 'GitHub.com'
}
group = gitHubRepository.owner.login
gitHubOwners.add(group)
} else {
group = KnownRepositoryGroup.Enterprise
}
@ -95,22 +90,13 @@ export function groupRepositories(
localRepositoryStateLookup.get(r.id) || fallbackValue
const repositoryText =
r instanceof Repository ? [r.name, nameOf(r)] : [r.name]
if (enableGroupRepositoriesByOwner()) {
return {
text: repositoryText,
id: r.id.toString(),
repository: r,
needsDisambiguation:
nameCount > 1 && identifier === KnownRepositoryGroup.Enterprise,
aheadBehind,
changedFilesCount,
}
}
return {
text: [r.name],
text: repositoryText,
id: r.id.toString(),
repository: r,
needsDisambiguation: nameCount > 1,
needsDisambiguation:
nameCount > 1 && identifier === KnownRepositoryGroup.Enterprise,
aheadBehind,
changedFilesCount,
}
@ -120,13 +106,10 @@ export function groupRepositories(
}
// NB: This ordering reflects the order in the repositories sidebar.
if (enableGroupRepositoriesByOwner()) {
const owners = [...gitHubOwners.values()]
owners.sort(caseInsensitiveCompare)
owners.forEach(addGroup)
} else {
addGroup('GitHub.com')
}
const owners = [...gitHubOwners.values()]
owners.sort(caseInsensitiveCompare)
owners.forEach(addGroup)
addGroup(KnownRepositoryGroup.Enterprise)
addGroup(KnownRepositoryGroup.NonGitHub)

View file

@ -20,7 +20,6 @@ import { IMenuItem } from '../../lib/menu-item'
import { PopupType } from '../../models/popup'
import { encodePathAsUrl } from '../../lib/path'
import memoizeOne from 'memoize-one'
import { enableGroupRepositoriesByOwner } from '../../lib/feature-flag'
const BlankSlateImage = encodePathAsUrl(__dirname, 'static/empty-no-repo.svg')
@ -161,11 +160,9 @@ export class RepositoriesList extends React.Component<
private renderGroupHeader = (id: string) => {
const identifier = id as RepositoryGroupIdentifier
const label = this.getGroupLabel(identifier)
const className = enableGroupRepositoriesByOwner()
? 'filter-list-group-header group-repositories-by-owner'
: 'filter-list-group-header'
return (
<div key={identifier} className={className}>
<div key={identifier} className="filter-list-group-header">
{label}
</div>
)
@ -193,7 +190,6 @@ export class RepositoriesList extends React.Component<
)
const groups =
enableGroupRepositoriesByOwner() &&
this.props.repositories.length > recentRepositoriesThreshold
? [
makeRecentRepositoriesGroup(

View file

@ -11,7 +11,6 @@ import {
RevealInFileManagerLabel,
DefaultEditorLabel,
} from '../lib/context-menu'
import { enableGroupRepositoriesByOwner } from '../../lib/feature-flag'
interface IRepositoryListItemProps {
readonly repository: Repositoryish
@ -71,33 +70,12 @@ export class RepositoryListItem extends React.Component<
prefix = `${gitHubRepo.owner.login}/`
}
const className = enableGroupRepositoriesByOwner()
? 'repository-list-item group-repositories-by-owner'
: 'repository-list-item'
return (
<div
onContextMenu={this.onContextMenu}
className={className}
className="repository-list-item"
title={repoTooltip}
>
{!enableGroupRepositoriesByOwner() && (
<div
className="change-indicator-wrapper"
title={
hasChanges
? 'There are uncommitted changes in this repository'
: ''
}
>
{hasChanges ? (
<Octicon
className="change-indicator"
symbol={OcticonSymbol.primitiveDot}
/>
) : null}
</div>
)}
<Octicon
className="icon-for-repository"
symbol={iconForRepository(repository)}
@ -113,7 +91,7 @@ export class RepositoryListItem extends React.Component<
{repository instanceof Repository &&
renderRepoIndicators({
aheadBehind: this.props.aheadBehind,
hasChanges: enableGroupRepositoriesByOwner() && hasChanges,
hasChanges: hasChanges,
})}
</div>
)
@ -220,12 +198,9 @@ const renderAheadBehindIndicator = (aheadBehind: IAheadBehind) => {
}
const renderChangesIndicator = () => {
const classNames = enableGroupRepositoriesByOwner()
? 'change-indicator-wrapper group-repositories-by-owner'
: 'change-indicator-wrapper'
return (
<div
className={classNames}
className="change-indicator-wrapper"
title="There are uncommitted changes in this repository"
>
<Octicon symbol={OcticonSymbol.primitiveDot} />

View file

@ -26,7 +26,7 @@ import { IMenu } from '../models/app-menu'
import { StashDiffViewer } from './stashing'
import { StashedChangesLoadStates } from '../models/stash-entry'
import { TutorialPanel, TutorialWelcome, TutorialDone } from './tutorial'
import { enableTutorial, enableNDDBBanner } from '../lib/feature-flag'
import { enableNDDBBanner } from '../lib/feature-flag'
import { TutorialStep, isValidTutorialStep } from '../models/tutorial-step'
import { ExternalEditor } from '../lib/editors'
@ -367,10 +367,7 @@ export class RepositoryView extends React.Component<
}
if (workingDirectory.files.length === 0) {
if (
enableTutorial() &&
this.props.currentTutorialStep !== TutorialStep.NotApplicable
) {
if (this.props.currentTutorialStep !== TutorialStep.NotApplicable) {
return this.renderTutorialPane()
} else {
return (
@ -472,10 +469,7 @@ export class RepositoryView extends React.Component<
}
private maybeRenderTutorialPanel(): JSX.Element | null {
if (
enableTutorial() &&
isValidTutorialStep(this.props.currentTutorialStep)
) {
if (isValidTutorialStep(this.props.currentTutorialStep)) {
return (
<TutorialPanel
dispatcher={this.props.dispatcher}

View file

@ -160,7 +160,7 @@ class TabBarItem extends React.Component<ITabBarItemProps, {}> {
onClick={this.onClick}
role="tab"
aria-selected={selected}
tabIndex={selected ? 0 : -1}
tabIndex={selected ? undefined : -1}
onKeyDown={this.onKeyDown}
type="button"
>

View file

@ -51,8 +51,8 @@
// Positioning
position: absolute;
top: 0px;
right: 3px;
width: 15px;
right: 1px;
width: 12px;
// Only support vertical scrolling for now
overflow-y: auto;

View file

@ -34,10 +34,6 @@
// name and truncate accordingly
width: 100%;
&:not(.group-repositories-by-owner) {
padding-left: 0;
}
.icon-for-repository {
// Some room between the icon and repository name
margin-right: var(--spacing-half);
@ -71,6 +67,7 @@
display: flex;
justify-content: flex-end;
align-items: center;
margin-right: var(--spacing-half);
}
.change-indicator-wrapper {
@ -84,10 +81,6 @@
color: var(--tab-bar-active-color);
width: auto;
}
&:not(.group-repositories-by-owner) {
margin-right: var(--spacing-half);
}
}
.ahead-behind {
@ -117,7 +110,7 @@
}
}
.filter-list-group-header.group-repositories-by-owner {
.filter-list-group-header {
padding-top: var(--spacing);
}

View file

@ -16,7 +16,9 @@
border-bottom: var(--base-border);
padding: 0 var(--spacing);
// We need to give a bit more padding to the right to make place for the scrollbar
padding-right: calc(var(--spacing) + var(--spacing-half));
padding-left: var(--spacing);
.info {
display: flex;
@ -50,6 +52,7 @@
margin-left: var(--spacing);
color: var(--list-item-badge-color);
height: 16px;
line-height: 16px;
max-width: 50%;
.tag-indicator {

View file

@ -1,5 +1,20 @@
{
"releases": {
"2.5.1-beta1": [
"[Fixed] Center tags text vertically in History view - #9785",
"[Fixed] Prevent Git authentication errors from prompting to retry clone instead of authentication dialog - #9777",
"[Improved] Avoid executing unwanted Git hooks when fetching unpushed tags - #9793"
],
"2.5.0": [
"[New] Add, push, and view Git tags on commit history in Desktop - #9424",
"[Added] Offer option to choose file from one branch or the other when resolving merge conflicts - #9702",
"[Added] Add context menu for highlighted text in diff view - #5100. Thanks @HashimotoYT!",
"[Fixed] Retain default branch option in \"Create Branch\" dialog when user focuses away from Desktop - #9611",
"[Improved] Clean up copy for onboarding sign-in flow - #9715",
"[Improved] Emphasize signing in to GitHub via browser due to username/password deprecation - #9663",
"[Improved] Improve error message when publishing a private repository fails - #9646",
"[Improved] Offer to retry if cloning a repository fails - #926. Thanks @Daniel-McCarthy!"
],
"2.4.4-beta4": [
"[Fixed] Add missing \"Cancel\" button in onboarding sign-in flow - #9715",
"[Improved] Update copy for onboarding sign-in flow - #9715"

View file

@ -114,7 +114,7 @@ are unable to find another cygwin DLL.
Enabling Mandatory ASLR affects the MSYS2 core library, which is relied upon by Git for Windows to emulate process forking.
**Not supported:** this is an upstream limitation of MSYS2, and it is recommend that you either disable Mandatory ASLR or whitelist all executables under `<Git>\usr\bin` which depend on MSYS2.
**Not supported:** this is an upstream limitation of MSYS2, and it is recommend that you either disable Mandatory ASLR or explicitly allow all executables under `<Git>\usr\bin` which depend on MSYS2.
### I get a black screen when launching Desktop