Create $GIT_DIR/objects/pack if missing during renameAndOpenPack
commit5546ab3f9407f7bd76eeccd7a9285b0935a96cd0
authorShawn O. Pearce <spearce@spearce.org>
Sun, 10 May 2009 21:30:46 +0000 (10 14:30 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Mon, 11 May 2009 05:39:43 +0000 (11 07:39 +0200)
treedbdd4f219db236f53665a03e88ddba3da84c500b
parente4bf8f6957bbb29362575d641d1e77a02d906739
Create $GIT_DIR/objects/pack if missing during renameAndOpenPack

Its OK for the objects/pack directory to be missing, an empty
repository doesn't have to have it.  C Git's `git repack` will
automatically create the directory if it is not present, so we
need to do the same behavior here.

When the directory doesn't exist, we try to create it, but we
may have creation fail if another concurrent thread/process also
made the directory at the same time, hence we test once more after
creation failure before throwing the exception.

Found-by: Mark Struberg <struberg@yahoo.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java