From 6ced0034ef5995e215b6962d66ff013fdcc374c0 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Thu, 19 Oct 2023 20:43:31 +0900 Subject: [PATCH] feat: team: shallow clone team project (#774) * feat: team: shallow clone team project Implement RFE#1720 Signed-off-by: Hiroshi Miura * docs: update changes.txt Signed-off-by: Hiroshi Miura * wip: make it final Signed-off-by: Hiroshi Miura --------- Signed-off-by: Hiroshi Miura --- release/changes.txt | 3 +++ src/org/omegat/core/team2/impl/GITRemoteRepository2.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/release/changes.txt b/release/changes.txt index a46b48d970..408635678d 100644 --- a/release/changes.txt +++ b/release/changes.txt @@ -8,6 +8,9 @@ Implemented requests: + - Download team project with a shallow history + https://sourceforge.net/p/omegat/feature-requests/1720/ + - ResourceBundle Filter: default not to escape Unicode character https://sourceforge.net/p/omegat/feature-requests/1716/ diff --git a/src/org/omegat/core/team2/impl/GITRemoteRepository2.java b/src/org/omegat/core/team2/impl/GITRemoteRepository2.java index 452e68adc2..fd7dd1a70f 100644 --- a/src/org/omegat/core/team2/impl/GITRemoteRepository2.java +++ b/src/org/omegat/core/team2/impl/GITRemoteRepository2.java @@ -106,6 +106,7 @@ public class GITRemoteRepository2 implements IRemoteRepository2 { // allow override timeout. protected static final int TIMEOUT = 30; // seconds + protected static final int CLONE_DEPTH = 1; // clone depth String repositoryURL; String branch; @@ -189,6 +190,7 @@ public void init(RepositoryDefinition repo, File dir, ProjectTeamSettings teamSe c.setURI(repositoryURL); c.setDirectory(localDirectory); c.setTimeout(TIMEOUT); + c.setDepth(CLONE_DEPTH); try { c.call(); } catch (InvalidRemoteException e) {