summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenaud Paquay <rpaquay@google.com>2017-01-27 11:41:12 -0800
committerRenaud Paquay <rpaquay@google.com>2017-08-31 13:49:59 -0700
commit788e9626ccefa2e40aab58b67a1487e2a26b8225 (patch)
treeba39c11ae8331c87303311062d626ce2f706a0c7
parentcd892a38a61e2cb5975189a8f6e61fe1cd72d2c1 (diff)
downloadgit-repo-788e9626ccefa2e40aab58b67a1487e2a26b8225.tar.gz
Provide more specific error message for symlinks errors on Windows
Change-Id: Ia6099beef37ae6b6143eba243fe7fbe02b74a9bb
-rw-r--r--project.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/project.py b/project.py
index 338ce93c..e1a844e7 100644
--- a/project.py
+++ b/project.py
@@ -2400,7 +2400,7 @@ class Project(object):
2400 os.path.relpath(stock_hook, os.path.dirname(dst)), dst) 2400 os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
2401 except OSError as e: 2401 except OSError as e:
2402 if e.errno == errno.EPERM: 2402 if e.errno == errno.EPERM:
2403 raise GitError('filesystem must support symlinks') 2403 raise GitError(self._get_symlink_error_message())
2404 else: 2404 else:
2405 raise 2405 raise
2406 2406
@@ -2514,7 +2514,7 @@ class Project(object):
2514 2514
2515 except OSError as e: 2515 except OSError as e:
2516 if e.errno == errno.EPERM: 2516 if e.errno == errno.EPERM:
2517 raise DownloadError('filesystem must support symlinks') 2517 raise DownloadError(self._get_symlink_error_message())
2518 else: 2518 else:
2519 raise 2519 raise
2520 2520
@@ -2555,6 +2555,14 @@ class Project(object):
2555 platform_utils.rmtree(dotgit) 2555 platform_utils.rmtree(dotgit)
2556 raise 2556 raise
2557 2557
2558 def _get_symlink_error_message(self):
2559 if platform_utils.isWindows():
2560 return ('Unable to create symbolic link. Please re-run the command as '
2561 'Administrator, or see '
2562 'https://github.com/git-for-windows/git/wiki/Symbolic-Links '
2563 'for other options.')
2564 return 'filesystem must support symlinks'
2565
2558 def _gitdir_path(self, path): 2566 def _gitdir_path(self, path):
2559 return platform_utils.realpath(os.path.join(self.gitdir, path)) 2567 return platform_utils.realpath(os.path.join(self.gitdir, path))
2560 2568