Bug 581234 - Wrong file after apply command
Summary: Wrong file after apply command
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 6.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 6.5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-15 18:45 EST by Yuriy Mitrofanov CLA
Modified: 2022-12-26 17:46 EST (History)
1 user (show)

See Also:


Attachments
file diff picture and both patch (934.24 KB, application/x-xz)
2022-12-15 18:45 EST, Yuriy Mitrofanov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuriy Mitrofanov CLA 2022-12-15 18:45:05 EST
Created attachment 288891 [details]
file diff picture and both patch

Here is a brief description of the problem:

I have a repository with only 3 commits.
1 - init commit
2 - add new pom.xml file
3 - change pom.xml file

after second commit
pom.xml 100644 78e2a3b63c2a0bb3257f3148882afe863306087d

after third commit
pom.xml 100644 e94a2b41013a61f0707955cf2c197f9c0c689e32

After that I create an empty repository, I add the first commit to it.

Then I apply patch 1, create commit 2, apply patch 2, create commit 3 using Git C
I get the identical state of the file.

after second commit
pom.xml 100644 78e2a3b63c2a0bb3257f3148882afe863306087d

after third commit
pom.xml 100644 e94a2b41013a61f0707955cf2c197f9c0c689e32

Let's do the same operations through jgit

Create an empty repository, I add the first commit to it.

Apply patch 1 and create commit 2
after second commit
pom.xml 100644 78e2a3b63c2a0bb3257f3148882afe863306087d

Apply patch 2 and create commit 3
after third commit (Wrong)
pom.xml 100644 99dd0fe04c12084105636eaa1582588036ac5ffd

Now let's compare the files
As you can see in the attached picture, the files are different.
Attached files for both patches.
Comment 1 Eclipse Genie CLA 2022-12-16 17:45:22 EST
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/197724