aboutsummaryrefslogtreecommitdiffstats
path: root/worktree.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-08-02 13:13:46 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-08-02 13:13:46 +0200
commitab655650034b2acf36ce0237acaaf28b5d2572c0 (patch)
treec6d277c2650712726445c6cb15c47ffa63676263 /worktree.go
parent171b3a73e7ab7015f9eb8e98965e36dfb8ea9599 (diff)
downloadgo-git-ab655650034b2acf36ce0237acaaf28b5d2572c0.tar.gz
*: use the new API for ReferenceName.Is* methods
Diffstat (limited to 'worktree.go')
-rw-r--r--worktree.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/worktree.go b/worktree.go
index 4e4d544..d2ac6f5 100644
--- a/worktree.go
+++ b/worktree.go
@@ -209,7 +209,7 @@ func (w *Worktree) getCommitFromCheckoutOptions(opts *CheckoutOptions) (plumbing
return plumbing.ZeroHash, err
}
- if !b.IsTag() {
+ if !b.Name().IsTag() {
return b.Hash(), nil
}
@@ -244,7 +244,7 @@ func (w *Worktree) setHEADToBranch(branch plumbing.ReferenceName, commit plumbin
}
var head *plumbing.Reference
- if target.IsBranch() {
+ if target.Name().IsBranch() {
head = plumbing.NewSymbolicReference(plumbing.HEAD, target.Name())
} else {
head = plumbing.NewHashReference(plumbing.HEAD, commit)
@@ -323,7 +323,7 @@ func (w *Worktree) setHEADCommit(commit plumbing.Hash) error {
return err
}
- if !branch.IsBranch() {
+ if !branch.Name().IsBranch() {
return fmt.Errorf("invalid HEAD target should be a branch, found %s", branch.Type())
}