File tree Expand file tree Collapse file tree 4 files changed +16
-8
lines changed
api/src/main/java/org/locationtech/geogig/repository
cli/core/src/main/java/org/locationtech/geogig/cli/porcelain
core/src/main/java/org/locationtech/geogig Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 1111
1212import java .util .function .Function ;
1313
14- import com .google .common .base .Preconditions ;
1514import com .google .common .util .concurrent .AtomicDouble ;
1615
1716/**
Original file line number Diff line number Diff line change 2828import org .locationtech .geogig .plumbing .RevParse ;
2929import org .locationtech .geogig .plumbing .merge .ReadMergeCommitMessageOp ;
3030import org .locationtech .geogig .porcelain .CommitOp ;
31- import org .locationtech .geogig .porcelain .ConflictsException ;
3231import org .locationtech .geogig .porcelain .NothingToCommitException ;
3332import org .locationtech .geogig .repository .DiffObjectCount ;
3433import org .locationtech .geogig .repository .ProgressListener ;
@@ -121,7 +120,7 @@ public void runInternal(GeogigCLI cli) throws IOException {
121120 commitOp .setCommit (geogig .getRepository ().getCommit (commitId .get ()));
122121 }
123122 commit = commitOp .setPathFilters (pathFilters ).setProgressListener (progress ).call ();
124- } catch (NothingToCommitException | ConflictsException
123+ } catch (NothingToCommitException
125124 | IllegalStateException notificationError ) {
126125 throw new CommandFailedException (notificationError .getMessage (), true );
127126 }
Original file line number Diff line number Diff line change @@ -164,22 +164,25 @@ private void updateRefs() {
164164 if (rebase ) {
165165 // Try to rebase
166166 transaction .command (CheckoutOp .class ).setSource (refName ).setForce (true )
167- .call ();
167+ .setProgressListener ( getProgressListener ()). call ();
168168 transaction .command (RebaseOp .class )
169169 .setUpstream (Suppliers .ofInstance (currentRef .get ().getObjectId ()))
170- .call ();
170+ .setProgressListener ( getProgressListener ()). call ();
171171
172172 updatedRef = transaction .command (RefParse .class ).setName (refName ).call ()
173173 .get ();
174174 } else {
175175 // sync transactions have to use merge to prevent divergent history
176176 transaction .command (CheckoutOp .class ).setSource (refName ).setForce (true )
177- .call ();
177+ .setProgressListener ( getProgressListener ()). call ();
178178 try {
179179 transaction .command (MergeOp .class )
180180 .setAuthor (authorName .orNull (), authorEmail .orNull ())
181- .addCommit (currentRef .get ().getObjectId ()).call ();
181+ .addCommit (currentRef .get ().getObjectId ())
182+ .setProgressListener (getProgressListener ()).call ();
182183 } catch (NothingToCommitException e ) {
184+ LOGGER .debug ("Transaction merge for {} unnecessary. {}" ,
185+ currentRef .get ().getName (), e .getMessage ());
183186 // The repo commit is already in our history, this is a fast
184187 // forward.
185188 }
Original file line number Diff line number Diff line change 2121import org .locationtech .geogig .porcelain .ConflictsException ;
2222import org .locationtech .geogig .repository .AbstractGeoGigOp ;
2323import org .locationtech .geogig .repository .Context ;
24+ import org .locationtech .geogig .repository .DefaultProgressListener ;
2425import org .locationtech .geogig .repository .Platform ;
26+ import org .locationtech .geogig .repository .ProgressListener ;
2527import org .locationtech .geogig .repository .Repository ;
2628import org .locationtech .geogig .repository .StagingArea ;
2729import org .locationtech .geogig .repository .WorkingTree ;
@@ -155,8 +157,13 @@ public String toString() {
155157 }
156158
157159 public void commit () throws ConflictsException {
160+ commit (DefaultProgressListener .NULL );
161+ }
162+
163+ public void commit (ProgressListener listener ) throws ConflictsException {
158164 context .command (TransactionEnd .class ).setAuthor (authorName .orNull (), authorEmail .orNull ())
159- .setTransaction (this ).setCancel (false ).setRebase (true ).call ();
165+ .setTransaction (this ).setCancel (false ).setRebase (true ).setProgressListener (listener )
166+ .call ();
160167 }
161168
162169 public void commitSyncTransaction () throws ConflictsException {
You can’t perform that action at this time.
0 commit comments