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 3913cce commit 81ea317
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/ui/add-repository/add-existing-repository.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { OkCancelButtonGroup } from '../dialog/ok-cancel-button-group'
import untildify from 'untildify'
import { showOpenDialog } from '../main-process-proxy'
import { Ref } from '../lib/ref'
import { isGitRepository } from './create-repository'

interface IAddExistingRepositoryProps {
readonly dispatcher: Dispatcher
Expand Down Expand Up @@ -218,9 +219,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 81ea317

Please sign in to comment.