File tree Expand file tree Collapse file tree
app/src/ui/repositories-list Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ import { IAheadBehind } from '../../models/branch'
2929import { ShowBranchNameInRepoListSetting } from '../../models/show-branch-name-in-repo-list'
3030import { normalizePath } from '../../lib/helpers/path'
3131import { ClickSource } from '../lib/list'
32- import { getRepositoryType } from '../../lib/git/rev-parse'
3332import { FoldoutType } from '../../lib/app-state'
3433import { pruneWorktrees } from '../../lib/git/worktree'
3534import { getEditorOverrideLabel } from '../../models/editor-override'
@@ -397,13 +396,14 @@ export class RepositoriesList extends React.Component<
397396 return
398397 }
399398
400- const repositoryType = await getRepositoryType ( worktreePath )
401- if ( repositoryType . kind !== 'regular' ) {
402- throw new Error ( `${ worktreePath } isn't a Git repository.` )
399+ const addedRepos = await this . props . dispatcher . addRepositories (
400+ [ worktreePath ] ,
401+ item . sourceRepository . login
402+ )
403+ if ( addedRepos . length > 0 ) {
404+ await this . props . dispatcher . selectRepository ( addedRepos [ 0 ] )
405+ await this . props . dispatcher . closeFoldout ( FoldoutType . Repository )
403406 }
404-
405- await this . props . dispatcher . selectRepository ( item . repository , false )
406- await this . props . dispatcher . closeFoldout ( FoldoutType . Repository )
407407 }
408408
409409 private onRemoveLinkedWorktree = ( item : IRepositoryListItem ) => {
You can’t perform that action at this time.
0 commit comments