Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Duft2017-12-05 08:30:48 +0000
committerMatthias Sohn2018-01-22 23:48:00 +0000
commit1c43af8b9794abcad7a4ac77c352626063aa1f05 (patch)
tree66774e581b0f9d05f8fc8936b8a108ee3376a071 /org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
parent14167272c289836550f359108b5ee7d65f2016d1 (diff)
downloadjgit-1c43af8b9794abcad7a4ac77c352626063aa1f05.tar.gz
jgit-1c43af8b9794abcad7a4ac77c352626063aa1f05.tar.xz
jgit-1c43af8b9794abcad7a4ac77c352626063aa1f05.zip
Progress reporting for checkout
The reason for the change is LFS: when using a lot of LFS files, checkout can take quite some time on larger repositories. To avoid "hanging" UI, provide progress reporting. Also implement (partial) progress reporting for cherry-pick, reset, revert which are using checkout internally. The feature is also useful without LFS, so it is independent of it. Change-Id: I021e764241f3c107eaf2771f6b5785245b146b42 Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
index 1f80301f66..6ff39fab04 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
@@ -57,6 +57,7 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.TextProgressMonitor;
import org.eclipse.jgit.pgm.internal.CLIText;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
@@ -90,7 +91,8 @@ class Checkout extends TextBuiltin {
}
try (Git git = new Git(db)) {
- CheckoutCommand command = git.checkout();
+ CheckoutCommand command = git.checkout()
+ .setProgressMonitor(new TextProgressMonitor(errw));
if (paths.size() > 0) {
command.setStartPoint(name);
if (paths.size() == 1 && paths.get(0).equals(".")) { //$NON-NLS-1$

Back to the top