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.
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.