summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2008-11-03 09:59:36 -0800
committerShawn O. Pearce <sop@google.com>2008-11-03 09:59:36 -0800
commit438ee1cad98ac32509718976e63c36a449bfb679 (patch)
tree9627a7fc84e5aab01a2ece8eae6c0ac045e20a46
parent23d7781c0bac53b24f4598104e8ba38310e8d100 (diff)
downloadgit-repo-438ee1cad98ac32509718976e63c36a449bfb679.tar.gz
Catch symlink creation failures and report a better error
Some users have noticed that repo doesn't work on VFAT, as we require a POSIX filesystem with POSIX symlink support. Catching the OSError during our symlink creation and raising a GitError with a more descriptive message will help users to troubleshoot and fix their own installation problems. Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r--project.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/project.py b/project.py
index ffbdfd1c..874a40bd 100644
--- a/project.py
+++ b/project.py
@@ -12,6 +12,7 @@
12# See the License for the specific language governing permissions and 12# See the License for the specific language governing permissions and
13# limitations under the License. 13# limitations under the License.
14 14
15import errno
15import filecmp 16import filecmp
16import os 17import os
17import re 18import re
@@ -864,8 +865,14 @@ class Project(object):
864 'refs', 865 'refs',
865 'rr-cache', 866 'rr-cache',
866 'svn']: 867 'svn']:
867 os.symlink(os.path.join(relgit, name), 868 try:
868 os.path.join(dotgit, name)) 869 os.symlink(os.path.join(relgit, name),
870 os.path.join(dotgit, name))
871 except OSError, e:
872 if e.errno == errno.EPERM:
873 raise GitError('filesystem must support symlinks')
874 else:
875 raise
869 876
870 rev = self.GetRemote(self.remote.name).ToLocal(self.revision) 877 rev = self.GetRemote(self.remote.name).ToLocal(self.revision)
871 rev = self.bare_git.rev_parse('%s^0' % rev) 878 rev = self.bare_git.rev_parse('%s^0' % rev)