mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-11-03 20:15:52 +01:00 
			
		
		
		
	implement branch option for git log command
This commit is contained in:
		@@ -250,6 +250,10 @@ public class GitUtil
 | 
			
		||||
    throws IOException
 | 
			
		||||
  {
 | 
			
		||||
    ObjectId branchId = null;
 | 
			
		||||
    if ( ! branchName.startsWith(REF_HEAD) ){
 | 
			
		||||
      branchName = PREFIX_HEADS.concat(branchName);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    Ref ref = repo.getRef(branchName);
 | 
			
		||||
 | 
			
		||||
    if (ref != null)
 | 
			
		||||
 
 | 
			
		||||
@@ -217,7 +217,16 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
 | 
			
		||||
              PathFilter.create(request.getPath()), TreeFilter.ANY_DIFF));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ObjectId head = GitUtil.getRepositoryHead(gr);
 | 
			
		||||
        ObjectId head = null;
 | 
			
		||||
 | 
			
		||||
        if (!Strings.isNullOrEmpty(request.getBranch()))
 | 
			
		||||
        {
 | 
			
		||||
          head = GitUtil.getBranchId(gr, request.getBranch());
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
          head = GitUtil.getRepositoryHead(gr);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (head != null)
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user