Issue 1026: Incorrect handling of file system errors in merge operation
Status:  New
Owner: ----
Reported by TheMole...@gmail.com, Jun 29, 2011
Affected Version: 2.1.8

What steps will reproduce the problem?
1. Have a pending change
2. 'Accidentally' change the ownership of some of the object directories in the git repository to be owned by root/root
3. Attempt to submit and merge the change.

What is the expected output? What do you see instead?
The merge will fail (as it is unable to create files/folders). The merge will be removed from the queue.
The status on the merge is left as "submitted, merge pending" even though gerrit isn't trying to do it anymore.
The logs will show an appropraite error message
Merge attempt for MY_PROJECT,refs/heads/master failed
com.google.gerrit.server.git.MergeException: Cannot merge 31f9cf56c844a643edeabda31707c48580e70360
        at com.google.gerrit.server.git.MergeOp.mergeOneCommit(MergeOp.java:472)
…
Caused by: java.io.IOException: Creating directory PATH/review_site/git/MY_PROJECT.git/objects/66 failed
        at org.eclipse.jgit.util.FileUtils.mkdir(FileUtils.java:174)
        at org.eclipse.jgit.util.FileUtils.mkdir(FileUtils.java:152)
        at org.eclipse.jgit.storage.file.ObjectDirectory.insertUnpackedObject(ObjectDirectory.java:580)
        at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insert(ObjectDirectoryInserter.java:89)
        at org.eclipse.jgit.lib.ObjectInserter.insert(ObjectInserter.java:271)
        at org.eclipse.jgit.lib.ObjectInserter.insert(ObjectInserter.java:251)
        at org.eclipse.jgit.lib.ObjectInserter.insert(ObjectInserter.java:222)
        at com.google.gerrit.server.git.MergeOp.commit(MergeOp.java:851)
        at com.google.gerrit.server.git.MergeOp.writeMergeCommit(MergeOp.java:545)
        at com.google.gerrit.server.git.MergeOp.mergeOneCommit(MergeOp.java:459)
        ... 58 more



Please provide any additional information below.
We generated this error condition after running the ExportReviewNotes command as root.
This will probably happen in various other conditions - such as disk full or glitches accessing a (remote) mount.