Community
Participate
Working Groups
Unless I'm doing something wrong, PullCommand doesn't give proper results when pulling a file is deleted on one side (local or remote) and modified on the other. Case 1, steps: 1. Have two clones: "source" and "target" (clone of "source") with "file.txt" 2. In source: "rm file.txt", "git rm file.txt", "git commit -m 'remove file'" 3. In target: modify "file.txt", "git add .", "git commit -m 'change file'" 4. In target: "git pull" => SHOULD BE: merge status saying "Conflicting" => IS (according to test, see attachment): "Merged" Case 2, steps: 1. Have two clones: "source" and "target" (clone of "source") with "file.txt" 2. In source: modify "file.txt", "git add .", "git commit -m 'change file'" 3. In target: "rm file.txt", "git rm file.txt", "git commit -m 'remove file'" 4. In target: "git pull" => SHOULD BE: merge status saying "Conflicting" => IS (according to test, see attachment): org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of merge command. org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with files: SomeFile.txt at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:251) at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:286) at org.eclipse.jgit.api.PullCommandTest.testPullDeletedChange(PullCommandTest.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:600) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with files: SomeFile.txt at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:387) at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:220) ... 27 more
Created attachment 193803 [details] failing test cases I will try to upload it to Gerrit in a minute.
http://egit.eclipse.org/r/3197
Actually it is the other way round: Case 1 leads to an exception, case 2 does the merge. Native git gives the following results: Case 1: ICT (delete/modify): file.txt deleted in a31114d09de0b55d775d96d0058492c61730fadf and modified in HEAD. Version HEAD of atic merge failed; fix conflicts and then commit the result. Case 2: ICT (delete/modify): file.txt deleted in HEAD and modified in 24a7d882d6a830fcd0e631e200900c1884bede2b. Version 24a7d882d6a8 atic merge failed; fix conflicts and then commit the result. The error is in class DirCacheCheckout.
Increasing severity. When we hit this in Orion we have no way to resolve the conflict without resorting to git command line.
It looks that one case has been fixed in http://egit.eclipse.org/r/#change,3294, but the other is still failing.
(In reply to comment #5) > It looks that one case has been fixed in http://egit.eclipse.org/r/#change,3294, > but the other is still failing. After examining the failing test it turned out it contained a typo. The latest patch set on http://egit.eclipse.org/r/3197 has it fixed... and all tests pass now. So it looks that http://egit.eclipse.org/r/#change,3294 (no bug number) fixed both cases.