Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Difference of behavior between native git and jgit

Hi Axel,

The result should be the same*. There is a special set of tests in
JGit [1] guarding that. So the best way to investigate this issue
would be adding a test for your case and pushing it to Gerrit [2]. I
would expect it to fail on the first run.

* unless there's a bug in native git and JGit is doing what you would expect ;)

Cheers,

[1] https://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java
[2] http://wiki.eclipse.org/EGit/Contributor_Guide

On Thu, Nov 28, 2013 at 10:48 AM, Axel RICHARD <axel.richard@xxxxxxx> wrote:
> Hi,
>
> I found a difference between native git and jgit. I try a simple test with
> few steps :
>
> 1. Create file 'a'
> 2. Add & Commit
> 3. Create branch 'br1'
> 4. Replace file 'a' (Rm 'a') by folder 'a' with a file 'c' inside
> 5. Add & Commit
> 6. Replace folder 'a' (Rm 'a') by a new file 'a'
> 7. Add 'a'
> 8. Checkout branch 'br1'
>
> With native git, I get this message after the checkout: "error: Your local
> changes to the following files would be overwritten by checkout: a
> Please, commit your changes or stash them before you can switch branches.
> Aborting"
> But with jgit, there is no error after calling the checkout, and the file
> 'a' is deleted from the working tree.
>
> Is it a normal behavior to have this difference ? Did I do something wrong
> in my test case ?
>
> Thank you in advance
>
> --
> Axel RICHARD
>
>
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jgit-dev
>


Back to the top