}
static Map<ObjectId, JSONArray> getCommitToBranchMap(URI cloneLocation, Repository db) throws GitAPIException, JSONException {
HashMap<ObjectId, JSONArray> commitToBranch = new HashMap<ObjectId, JSONArray>();
Git git = new Git(db);
List<Ref> branchRefs = git.branchList().setListMode(ListMode.ALL).call();
for (Ref branchRef : branchRefs) {
ObjectId commitId = branchRef.getLeaf().getObjectId();
JSONObject branch = new JSONObject();
branch.put(ProtocolConstants.KEY_FULL_NAME, branchRef.getName());