Skip to content

Commit

Permalink
Resolving a deadlock with git test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Praveen Innamuri committed Apr 15, 2014
1 parent 9381d73 commit c28b57b
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -101,15 +101,19 @@ protected void assertCommit(GitIndex index, String commitMessage) throws Excepti
GitRepository repo = getRepo();
try
{
repo.waitForWrite();
// Aquiring the write lock before commit might cause deadlock with a git refresh job that is already
// triggered (due to resource changes). After the commit is done, it refreshes and that requires the write
// lock.

// repo.waitForWrite();
IStatus status = index.commit(commitMessage);
assertTrue("Failed to commit: " + status.getMessage(), status.isOK());
assertTrue("After a commit, the repository changed file listing should be empty but is not", index
.changedFiles().isEmpty());
}
finally
{
repo.exitWriteProcess();
// repo.exitWriteProcess();
}
}

Expand Down

0 comments on commit c28b57b

Please sign in to comment.