@@ -57,7 +57,8 @@ export enum GitError {
5757 TagAlreadyExists ,
5858 MergeWithLocalChanges ,
5959 RebaseWithLocalChanges ,
60- MergeCommitNoMainlineOption
60+ MergeCommitNoMainlineOption ,
61+ UnsafeDirectory
6162}
6263
6364/** A mapping from regexes to the git error they identify. */
@@ -68,7 +69,7 @@ export const GitErrorRegexes: { [regexp: string]: GitError } = {
6869 'fatal: Authentication failed' : GitError . SSHAuthenticationFailed ,
6970 'fatal: Could not read from remote repository.' : GitError . SSHPermissionDenied ,
7071 'The requested URL returned error: 403' : GitError . HTTPSAuthenticationFailed ,
71- 'fatal: The remote end hung up unexpectedly' : GitError . RemoteDisconnection ,
72+ 'fatal: [Tt]he remote end hung up unexpectedly' : GitError . RemoteDisconnection ,
7273 "fatal: unable to access '(.+)': Failed to connect to (.+): Host is down" : GitError . HostDown ,
7374 "Cloning into '(.+)'...\nfatal: unable to access '(.+)': Could not resolve host: (.+)" :
7475 GitError . HostDown ,
@@ -91,7 +92,7 @@ export const GitErrorRegexes: { [regexp: string]: GitError } = {
9192 "Your configuration specifies to merge with the ref '(.+)'\nfrom the remote, but no such ref was fetched." :
9293 GitError . NoExistingRemoteBranch ,
9394 'nothing to commit' : GitError . NothingToCommit ,
94- "No submodule mapping found in .gitmodules for path '(.+)'" : GitError . NoSubmoduleMapping ,
95+ "[Nn]o submodule mapping found in .gitmodules for path '(.+)'" : GitError . NoSubmoduleMapping ,
9596 "fatal: repository '(.+)' does not exist\nfatal: clone of '.+' into submodule path '(.+)' failed" :
9697 GitError . SubmoduleRepositoryDoesNotExist ,
9798 "Fetched in submodule path '(.+)', but it did not contain (.+). Direct fetching of that commit failed." :
@@ -104,7 +105,7 @@ export const GitErrorRegexes: { [regexp: string]: GitError } = {
104105 GitError . NonFastForwardMergeIntoEmptyHead ,
105106 'error: (.+): (patch does not apply|already exists in working directory)' :
106107 GitError . PatchDoesNotApply ,
107- "fatal: A branch named '(.+)' already exists." : GitError . BranchAlreadyExists ,
108+ "fatal: [Aa] branch named '(.+)' already exists.? " : GitError . BranchAlreadyExists ,
108109 "fatal: bad revision '(.*)'" : GitError . BadRevision ,
109110 'fatal: [Nn]ot a git repository \\(or any of the parent directories\\): (.*)' :
110111 GitError . NotAGitRepository ,
@@ -145,7 +146,8 @@ export const GitErrorRegexes: { [regexp: string]: GitError } = {
145146 GitError . MergeWithLocalChanges ,
146147 'error: cannot (pull with rebase|rebase): You have unstaged changes\\.\n\\s*error: [Pp]lease commit or stash them\\.' :
147148 GitError . RebaseWithLocalChanges ,
148- 'error: commit (.+) is a merge but no -m option was given' : GitError . MergeCommitNoMainlineOption
149+ 'error: commit (.+) is a merge but no -m option was given' : GitError . MergeCommitNoMainlineOption ,
150+ "fatal: unsafe repository \\('(.+)' is owned by someone else\\)" : GitError . UnsafeDirectory
149151}
150152
151153/**
0 commit comments