Skip to content

Commit

Permalink
Merge pull request desktop#19141 from desktop/fix-allow-creating-repo…
Browse files Browse the repository at this point in the history
…sitory-out-of-subdirectory

Check if the path being checked is the create a new repo is actually the suggested new path
  • Loading branch information
tidy-dev authored Aug 22, 2024
2 parents c694b33 + 77d663d commit f239481
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/src/ui/add-repository/create-repository.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ export const isGitRepository = async (path: string) => {
return directoryExists(join(path, '.git'))
}

if (type.kind === 'regular') {
// If the path is a regular repository, we'll check if the top level. If it
// isn't than, the path is a subfolder of the repository and a user may want
// to make it into a repository.
// TODO: Opportunity to provide information about submodules?
return type.topLevelWorkingDirectory === path
}

return type.kind !== 'missing'
}

Expand Down

0 comments on commit f239481

Please sign in to comment.