Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
add extra logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 15, 2017
1 parent 9cdd599 commit 45911ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/utils/git.go
Expand Up @@ -60,29 +60,29 @@ func GitFetch(repoPath string, remoteRef string, localBranchName string) error {
//should not raise an error when looking for branch (we just created it above)
localBranch, berr := repo.LookupBranch(localBranchName, git2go.BranchLocal)
if berr != nil {
log.Print("Failed to lookup new local branch " + localBranchName)
log.Print("Failed to lookup new local branch " + fmt.Sprintf("%s:%s", remoteRef, localBranchName))
return berr
}

// Getting the tree for the branch
localCommit, err := repo.LookupCommit(localBranch.Target())
if err != nil {
log.Print("Failed to lookup for commit in local branch " + localBranchName)
log.Print("Failed to lookup for commit in local branch " + fmt.Sprintf("%s:%s", remoteRef, localBranchName))
return err
}
//defer localCommit.Free()

tree, err := repo.LookupTree(localCommit.TreeId())
if err != nil {
log.Print("Failed to lookup for tree " + localBranchName)
log.Print("Failed to lookup for tree " + fmt.Sprintf("%s:%s", remoteRef, localBranchName))
return err
}
//defer tree.Free()

// Checkout the tree
err = repo.CheckoutTree(tree, checkoutOpts)
if err != nil {
log.Print("Failed to checkout tree " + localBranchName)
log.Print("Failed to checkout tree " + fmt.Sprintf("%s:%s", remoteRef, localBranchName))
return err
}
// Setting the Head to point to our branch
Expand Down

0 comments on commit 45911ee

Please sign in to comment.