Changeset - d8993baa00dc
[Not reviewed]
default
0 1 0
Mads Kiilerich - 10 years ago 2015-05-27 23:15:36
madski@unity3d.com
git: avoid OSError when encountering invalid lock file

This avoids crashing when repo scanning makes dulwich look at its own pip
install directory.
1 file changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -12,6 +12,7 @@
 
import os
 
import re
 
import time
 
import errno
 
import urllib
 
import urllib2
 
import logging
 
@@ -690,7 +691,13 @@ class GitRepository(BaseRepository):
 
        runs gits update-server-info command in this repo instance
 
        """
 
        from dulwich.server import update_server_info
 
        update_server_info(self._repo)
 
        try:
 
            update_server_info(self._repo)
 
        except OSError, e:
 
            if e.errno != errno.ENOENT:
 
                raise
 
            # Workaround for dulwich crashing on for example its own dulwich/tests/data/repos/simple_merge.git/info/refs.lock
 
            log.error('Ignoring error running update-server-info: %s', e)
 

	
 
    @LazyProperty
 
    def workdir(self):
0 comments (0 inline, 0 general)