mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Provide more specific error message for symlinks errors on Windows
Change-Id: Ia6099beef37ae6b6143eba243fe7fbe02b74a9bb
This commit is contained in:
parent
cd892a38a6
commit
788e9626cc
12
project.py
12
project.py
@ -2400,7 +2400,7 @@ class Project(object):
|
|||||||
os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
|
os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == errno.EPERM:
|
if e.errno == errno.EPERM:
|
||||||
raise GitError('filesystem must support symlinks')
|
raise GitError(self._get_symlink_error_message())
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@ -2514,7 +2514,7 @@ class Project(object):
|
|||||||
|
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == errno.EPERM:
|
if e.errno == errno.EPERM:
|
||||||
raise DownloadError('filesystem must support symlinks')
|
raise DownloadError(self._get_symlink_error_message())
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@ -2555,6 +2555,14 @@ class Project(object):
|
|||||||
platform_utils.rmtree(dotgit)
|
platform_utils.rmtree(dotgit)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
def _get_symlink_error_message(self):
|
||||||
|
if platform_utils.isWindows():
|
||||||
|
return ('Unable to create symbolic link. Please re-run the command as '
|
||||||
|
'Administrator, or see '
|
||||||
|
'https://github.com/git-for-windows/git/wiki/Symbolic-Links '
|
||||||
|
'for other options.')
|
||||||
|
return 'filesystem must support symlinks'
|
||||||
|
|
||||||
def _gitdir_path(self, path):
|
def _gitdir_path(self, path):
|
||||||
return platform_utils.realpath(os.path.join(self.gitdir, path))
|
return platform_utils.realpath(os.path.join(self.gitdir, path))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user