code: public void addCommit(){
  		if(this.sha!=null){
  			Commit commit = new Commit(this.sha, this.mergeDetails, this.author, this.dateString,
  					this.message, this.files);
  			if (commitList == null){
  				commitList = new ArrayList<Commit>();
  			}
  
  			this.commitList.add(commit);
  			//reset variables for future commits.
  			this.files = null;
  			this.mergeDetails = null;
  			this.message = null;
  		}
  	}
docs: This add a newly created commit object to the list of commits for a log.