Re: [jgit-dev] Difference of behavior between native git and jgit
I push a review to reproduce the bug. Hope it can help you.
Le 28/11/2013 13:47, Halstrick,
Christian a écrit :
I think that’s a bug in JGit. I agree to Tomasz
that jgit and cgit should behave the same here. I can also
reproduce that in step 8 we loose the unsaved content in
file a. That’s a severe bug you found. The semantic which
git wants to provide is described in case 16 of . When we
are in step 8 of your test and inspect path ‘a’ then we find
In HEAD we see a tree
In worktree we see file with content x
In index we see file with content x
In MERGE (the commit which we want to checkout)
a file with content y
In this situation ‘clean’ is true and ‘I==H’
and ‘I==M’ are both false. The result is that the checkout
should fail. I’ll check why we haven’t detected that in our
tests up to now and maybe a fix.
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'
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
adr;quoted-printable:BP 20773 - ESPACE PERFORMANCE LA FLEURIAYE;;7, boulevard Amp=C3=A8re;CARQUEFOU;;44481;FRANCE
title:Eclipse Modeling Consultant