File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed
main/java/org/locationtech/geogig/remotes
test/java/org/locationtech/geogig/test/integration/remoting Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 1313import static com .google .common .base .Preconditions .checkNotNull ;
1414
1515import java .util .ArrayList ;
16- import java .util .Collection ;
1716import java .util .List ;
1817
1918import org .eclipse .jdt .annotation .Nullable ;
@@ -234,16 +233,6 @@ protected PullResult _call() {
234233 result .setOldRef (currentBranch );
235234 result .setRemote (suppliedRemote );
236235
237- // did fetch need to update any contents?
238- {
239- final Collection <RefDiff > fetchedRefs = fetchResult .getRefDiffs ()
240- .get (remote .getFetchURL ());
241- if (fetchedRefs == null || fetchedRefs .isEmpty ()) {
242- result .setNewRef (currentBranch );
243- return result ;
244- }
245- }
246-
247236 for (LocalRemoteRefSpec fetchspec : remote .getFetchSpecs ()) {
248237 final String localRemoteRefName = fetchspec .getLocal ();
249238 final Optional <Ref > localRemoteRefOpt = command (RefParse .class )
Original file line number Diff line number Diff line change @@ -166,6 +166,25 @@ public void testPullMerge() throws Exception {
166166 assertEquals (expectedMaster , logged );
167167 }
168168
169+ @ Test
170+ public void testPullMergeNothingToFetch () throws Exception {
171+ // Add a commit to the remote
172+ insertAndAdd (remoteGeogig .geogig , lines3 );
173+ RevCommit commit = commit (remoteGeogig .repo , "lines3" );
174+ expectedMaster .addFirst (commit );
175+
176+ // call fetch first so the missing objects are already in the local repo
177+ fetchOp ().call ();
178+
179+ // Then Pull should update the target ref even if there's nothing to fetch
180+ PullOp pull = pullOp ();
181+ pull .setRemote ("origin" ).call ();
182+
183+ List <RevCommit > logged = log (localGeogig .repo );
184+
185+ assertEquals (expectedMaster , logged );
186+ }
187+
169188 /**
170189 * Pull from a remote that's not being saved as named remote in the repository
171190 */
You can’t perform that action at this time.
0 commit comments