From ab655650034b2acf36ce0237acaaf28b5d2572c0 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Wed, 2 Aug 2017 13:13:46 +0200 Subject: *: use the new API for ReferenceName.Is* methods --- worktree.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'worktree.go') 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()) } -- cgit