When calling #setRepo on DiffFormatter, JGit creates a new repository reader. Under certain conditions, this reader may not contain the modifications made by the merger, resulting in an unknown object being accessed. This occurs because the merge result is not flushed to the repository - and this is the correct behavior in this specific case. Change-Id: Iaba970c1a6eec913de491a20ca781cadcdc3c56b