mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
lfs: only upload when LFS blobs are present
Summary: If no LFS blobs needs uploading, then don't try to connect to the LFS server in the first place. Reviewed By: DurhamG Differential Revision: D21478243 fbshipit-source-id: 81fa960d899b14f47aadf2fc90485747889041e1
This commit is contained in:
parent
0f6e81bbd7
commit
4e7303efd9
@ -1276,13 +1276,15 @@ impl RemoteDataStore for LfsRemoteStore {
|
||||
.filter_map(|res| res.transpose())
|
||||
.collect::<Result<Vec<_>>>()?;
|
||||
|
||||
self.remote.batch_upload(&objs, {
|
||||
let local_store = local_store.clone();
|
||||
move |sha256| {
|
||||
let key = StoreKey::from(ContentHash::Sha256(sha256));
|
||||
local_store.blob(&key)
|
||||
}
|
||||
})?;
|
||||
if !objs.is_empty() {
|
||||
self.remote.batch_upload(&objs, {
|
||||
let local_store = local_store.clone();
|
||||
move |sha256| {
|
||||
let key = StoreKey::from(ContentHash::Sha256(sha256));
|
||||
local_store.blob(&key)
|
||||
}
|
||||
})?;
|
||||
}
|
||||
|
||||
Ok(not_uploaded)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user