Skip to content

Commit b0ca80b

Browse files
committed
Fixed unnecessary LFS requests being made when pushing multiple objects
1 parent 118e0f9 commit b0ca80b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/kotlin/com/jetpackduba/gitnuro/lfs/AppLfsFactory.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ class LfsPrePushHook @AssistedInject constructor(
288288
is Result.Err -> throw LfsException("Gettings LFS objects failed with error: ${lfsObjects.error}")
289289
is Result.Ok -> {
290290
for (p in toPush) {
291-
lfsObjects.value.objects.forEach { lfsObject ->
291+
val lfsObject = lfsObjects.value.objects.firstOrNull { it.oid == p.oid.name() }
292+
293+
if (lfsObject != null) {
292294
val uploadResult = uploadLfsObjectUseCase(
293295
lfsServerUrl = finalServerUrl,
294296
lfsObject = lfsObject,

0 commit comments

Comments
 (0)