12 #include <boost/array.hpp> 39 class ObjectId :
public boost::array<unsigned char, 20> {
50 explicit ObjectId(
const std::string&
id);
54 std::string toString()
const;
120 typedef std::list<std::pair<std::string, std::string> >
Cache;
145 bool getCmdResult(
const std::string& cmd, std::string& result,
146 const std::string& tag)
const;
156 bool getCmdResult(
const std::string& cmd, std::string& result,
ObjectId getCommitTree(const std::string &revision) const
Get the tree for a particular revision.
std::list< std::pair< std::string, std::string > > Cache
Git utility class for browsing git archives.
std::string catFile(const ObjectId &id) const
Return the raw contents of a git object.
ObjectType
Git object type.
std::string repository_
The path to the repository.
ObjectId getCommit(const std::string &revision) const
Get the commit for a particular revision.
int getCmdResultLineCount(const std::string &cmd) const
Returns the number of lines in the output of a git command.
void checkRepository() const
Checks the repository.
bool getCmdResult(const std::string &cmd, std::string &result, const std::string &tag) const
Returns a line identified by a tag from the output of a git command.
Cache cache_
A small LRU cache that stores results of git commands.
Exception(const std::string &msg)
Constructor.
ObjectId getTreeFromCommit(const ObjectId &commit) const
Get the tree for a particular commit.
Object treeGetObject(const ObjectId &tree, int index) const
Get some info on a tree object.
int treeSize(const ObjectId &tree) const
Return the number of objects inside a tree object.
void setRepositoryPath(const std::string &repository)
Set the git repository path.