mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-10-26 00:56:09 +02:00
Fix simple repository export
This commit is contained in:
committed by
Florian Scholdei
parent
017e1c96fe
commit
9c5e9adbb4
2
gradle/changelog/export.yaml
Normal file
2
gradle/changelog/export.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: fixed
|
||||
description: Export of repositories
|
||||
@@ -52,7 +52,7 @@ public final class DefaultRepositoryExportingCheck implements RepositoryExportin
|
||||
} finally {
|
||||
int lockCount = getLockCount(repository.getId()).decrementAndGet();
|
||||
if (lockCount <= 0) {
|
||||
LOG.warn("Got negative export lock count {} for repository {}", lockCount, repository);
|
||||
LOG.debug("Lock count {} for repository {}", lockCount, repository);
|
||||
EXPORTING_REPOSITORIES.remove(repository.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import jakarta.ws.rs.core.UriInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
|
||||
import sonia.scm.BadRequestException;
|
||||
import sonia.scm.ConcurrentModificationException;
|
||||
@@ -78,6 +79,7 @@ import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
||||
import static sonia.scm.importexport.RepositoryTypeSupportChecker.checkSupport;
|
||||
import static sonia.scm.importexport.RepositoryTypeSupportChecker.type;
|
||||
|
||||
@Slf4j
|
||||
public class RepositoryExportResource {
|
||||
|
||||
private static final String NO_PASSWORD = "";
|
||||
@@ -484,7 +486,11 @@ public class RepositoryExportResource {
|
||||
if (compressed) {
|
||||
GzipCompressorOutputStream gzipCompressorOutputStream = new GzipCompressorOutputStream(os);
|
||||
bundleCommand.bundle(gzipCompressorOutputStream);
|
||||
gzipCompressorOutputStream.finish();
|
||||
try {
|
||||
gzipCompressorOutputStream.finish();
|
||||
} catch (NullPointerException e) {
|
||||
log.info("Could not finish gzip stream", e);
|
||||
}
|
||||
} else {
|
||||
bundleCommand.bundle(os);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user