Import fails if merge is enabled
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
git-upstream | Status tracked in Trunk | |||||
0.12 |
Fix Released
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Critical
|
Darragh Bailey |
Bug Description
I don't know how to describe the problem yet or identify the root cause.
I just know how to check if an import went well. (thanks to electrofelix on IRC #git-upstream)
This bug is a placeholder so we can track progress and add details later as we discover them.
How I can reproduce the problem on my side:
git-upstream import upstream-version
After import process is completed, the following output aren't identical:
git rev-parse master^{tree}
git rev-parse master^2^{tree}
I can however import just fine by running the import and finish steps separately:
git-upstream import --no-merge upstream-version
git-upstream import --finish --into master --import-branch import/
At this point, output of both git rev-parse commands are identical.
description: | updated |
description: | updated |
Changed in git-upstream: | |
importance: | Undecided → Critical |
assignee: | nobody → Darragh Bailey (dbailey-k) |
With the patch https:/ /review. openstack. org/378567 added to fix the logging options, and a local repo that exhibited the same issue, I've managed to work out what is happening.
The problem is that when a conflict occurs during a non-interactive import, when finish is called, the tree will be in a detached state and should ensure to use the current HEAD revision instead of the import branch (which will be still at the original state as the rebase has not performed it's post-steps). To do this, the finish() method sets a variable target_sha to contain either the import branch or the current HEAD sha1.
Unfortunately some of the code in the finish() method is still referencing import_branch instead of the correct variable target_sha.
The fix is relatively easy, it's the test case to catch this in the future that is trickier to implement. Basically need to simulate an import with a conflict during rebase and then complete the import and check the resulting state.