Skip to content

Commit

Permalink
fix: 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 Aug 11, 2024
1 parent 89938e0 commit b74f69b
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 @@ -16,6 +16,7 @@ import { showOpenDialog } from '../main-process-proxy'
import { Ref } from '../lib/ref'
import { InputError } from '../lib/input-description/input-error'
import { IAccessibleMessage } from '../../models/accessible-message'
import { isGitRepository } from './create-repository'

interface IAddExistingRepositoryProps {
readonly dispatcher: Dispatcher
Expand Down Expand Up @@ -278,9 +279,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 b74f69b

Please sign in to comment.