diff --git a/gitfs/repository.py b/gitfs/repository.py index 91b75279..905edcab 100644 --- a/gitfs/repository.py +++ b/gitfs/repository.py @@ -134,7 +134,7 @@ def _sanitize(self, path): return path def push(self, upstream, branch, credentials): - """ Push changes from a branch to a remote + """Push changes from a branch to a remote Examples:: @@ -157,7 +157,7 @@ def fetch(self, upstream, branch_name, credentials): return behind def commit(self, message, author, commiter, parents=None, ref="HEAD"): - """ Wrapper for create_commit. It creates a commit from a given ref + """Wrapper for create_commit. It creates a commit from a given ref (default is HEAD) """ @@ -423,7 +423,7 @@ def remote_head(self, upstream, branch): return remote.get_object() def get_remote(self, name): - """ Retrieve a remote by name. Raise a ValueError if the remote was not + """Retrieve a remote by name. Raise a ValueError if the remote was not added to repo Examples:: diff --git a/gitfs/views/current.py b/gitfs/views/current.py index 5e12b460..01cd4300 100644 --- a/gitfs/views/current.py +++ b/gitfs/views/current.py @@ -90,9 +90,9 @@ def getattr(self, path, fh=None): @not_in("ignore", check=["path"]) def write(self, path, buf, offset, fh): """ - We don't like big big files, so we need to be really carefull - with them. First we check for offset, then for size. If any of this - is off limit, raise EFBIG error and delete the file. + We don't like big big files, so we need to be really carefull + with them. First we check for offset, then for size. If any of this + is off limit, raise EFBIG error and delete the file. """ if offset + len(buf) > self.max_size: @@ -266,7 +266,12 @@ def _stage(self, message, add=None, remove=None): path = path.replace("{}/".format(add), "{}/".format(remove)) self.repo.index.remove(path) else: - self.repo.index.remove(remove) + try: + self.repo.index.remove(remove) + except OSError as e: + log.debug( + "failed to remove from cache: [{}] {}".format(e, type(e)) + ) else: self.repo.index.remove(remove) non_empty = True