Skip to content

Commit

Permalink
allow tilde character when specifying a local repository (#316)
Browse files Browse the repository at this point in the history
There already exists a function that will convert a tilde path to an absolute path. It was originally used for this purpose, but the functionality was removed during a commit that changed which function was used to validate git repositories.

This reinstates that functionality and allows us to type a ~/ tilde path to get our home directories when typing in a path.
  • Loading branch information
Daniel-McCarthy authored and shiftkey committed Apr 15, 2022
1 parent c4208a6 commit afc9abc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/src/ui/add-repository/add-existing-repository.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as React from 'react'
import * as Path from 'path'
import { Dispatcher } from '../dispatcher'
import { addGlobalConfigValueIfMissing, getRepositoryType } from '../../lib/git'
import {
addGlobalConfigValueIfMissing,
getRepositoryType,
isGitRepository,
} from '../../lib/git'
import { Button } from '../lib/button'
import { TextBox } from '../lib/text-box'
import { Row } from '../lib/row'
Expand Down Expand Up @@ -218,9 +222,9 @@ export class AddExistingRepository extends React.Component<
}

private onPathChanged = async (path: string) => {
if (this.state.path !== path) {
this.updatePath(path)
}
const isRepository = await isGitRepository(this.resolvedPath(path))

this.setState({ path, isRepository })
}

private showFilePicker = async () => {
Expand Down

0 comments on commit afc9abc

Please sign in to comment.