No longer rely on external service for LFS tracking #18
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "add_lfs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
And yes, the class name is strange now.
@ -0,0 +17,4 @@
return h.hexdigest()
md5 = functools.partial(_hash, hashlib.md5)
Do not remove the sha256, can be used during the download call (without storing the file). Note that you reimplemented it later with a similiar
for
@ -96,0 +51,4 @@
logging.debug(f"Add LFS for {project}/{package}/{name}")
fin = self.obs._download(project, package, name, revision)
sha = hashlib.sha256()
while True:
Here. This should be dropped.
@ -96,0 +57,4 @@
break
sha.update(buffer)
# only guess from the first 10K
if not mimetype:
ah ok, you use the loop for this, imho it is ok to move it out
Are you talking to yourself? 😄
What's the outcome?
IMHO do not mix both. Keep sha256 as a partial function, like the md5. This will work on the download-file-a-like handler.
The mime-type can be keep here (keeping an additional read), or moved into some place that consolidate stuff that answer all the questions about "is this a text file, is this a big file, what is the mime-type of this file, ..."
I won't download the file twice, no.