forked from adamm/git-importer
Also treat some more mimetypes as text
This commit is contained in:
@@ -6,6 +6,7 @@ import sys
|
||||
|
||||
import requests
|
||||
|
||||
from lib.binary import is_text_mimetype
|
||||
from lib.db import DB
|
||||
|
||||
|
||||
@@ -71,13 +72,13 @@ class LFSOid:
|
||||
VALUES (%s,%s,%s)""",
|
||||
(package, filename, lfs_oid_id),
|
||||
)
|
||||
if mimetype.startswith("text/"):
|
||||
if is_text_mimetype(mimetype):
|
||||
cur.execute(
|
||||
"INSERT INTO text_files (package,filename) VALUES (%s,%s)",
|
||||
(package, filename),
|
||||
)
|
||||
self.db.conn.commit()
|
||||
self.from_db(lfs_oid_id)
|
||||
self.set_from_dbid(lfs_oid_id)
|
||||
if not self.check():
|
||||
self.register()
|
||||
|
||||
|
Reference in New Issue
Block a user