github.com/Cloud-Foundations/Dominator@v0.3.4/lib/gitutil/api.go (about)

     1  package gitutil
     2  
     3  import (
     4  	"github.com/Cloud-Foundations/Dominator/lib/log"
     5  )
     6  
     7  type ShallowCloneParams struct {
     8  	GitBranch string   // Branch to fetch.
     9  	Patterns  []string // Patterns to fetch.
    10  	PublicURL string   // Repository URL which is safe to log.
    11  	RepoURL   string   // Real URL of repository.
    12  }
    13  
    14  // GetCommitIdOfRef will return the Commit ID of the specified reference.
    15  func GetCommitIdOfRef(topdir, ref string) (string, error) {
    16  	return getCommitIdOfRef(topdir, ref)
    17  }
    18  
    19  // ShallowClone will make a shallow clone of a Git repository. The repository
    20  // will be written to the directory specified by topdir.
    21  func ShallowClone(topdir string, params ShallowCloneParams,
    22  	logger log.DebugLogger) error {
    23  	return shallowClone(topdir, params, logger)
    24  }