public GitObject Find(string sha1Id)
{
if (sha1Id.Length != 40) throw new ArgumentException("Invalid SHA1 provided.", "sha1Id");
string dirName = sha1Id.Substring(0, 2);
string dirPath = Path.Combine(objectDir, dirName);
if (!Directory.Exists(dirPath))
throw new InvalidOperationException("Could not find SHA1 directory '" + dirName + "'.");
string filename = sha1Id.Substring(2);
string fullPath = Path.Combine(dirPath, filename);
if (!File.Exists(fullPath))
// should look in packs here?
throw new InvalidOperationException("Could not find SHA1 file with path '" + fullPath + "'.");
var uncompressedContent = zip.Decompress(fullPath);
var stream = new GitObjectStream(uncompressedContent);
return objectFactory.CreateFromContent(stream);
}