diff --git a/app/src/ui/add-repository/create-repository.tsx b/app/src/ui/add-repository/create-repository.tsx index 392c473a7af..14d635a7719 100644 --- a/app/src/ui/add-repository/create-repository.tsx +++ b/app/src/ui/add-repository/create-repository.tsx @@ -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' }