forked from importers/git-importer
Empty files should still have a mimetype assigned
This commit is contained in:
@@ -50,12 +50,12 @@ class ProxySHA256:
|
||||
sha = hashlib.sha256()
|
||||
while True:
|
||||
buffer = fin.read(10000)
|
||||
if not buffer:
|
||||
break
|
||||
sha.update(buffer)
|
||||
# only guess from the first 10K
|
||||
if not mimetype:
|
||||
mimetype = self.mime.from_buffer(buffer)
|
||||
if not buffer:
|
||||
break
|
||||
sha.update(buffer)
|
||||
fin.close()
|
||||
LFSOid(self.db).add(
|
||||
project, package, name, revision, sha.hexdigest(), size, mimetype, file_md5
|
||||
|
||||
Reference in New Issue
Block a user