diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-08-02 13:42:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-02 13:42:19 +0200 |
commit | 902347aef9a7cd618c48e3baa1121b72e2beab68 (patch) | |
tree | b81859d6dfa3c580191a2ad60bc1b7d80a36991a /worktree.go | |
parent | 9befb514d83e22268d00ab2c0fdd797b3742f0e9 (diff) | |
parent | ab655650034b2acf36ce0237acaaf28b5d2572c0 (diff) | |
download | go-git-902347aef9a7cd618c48e3baa1121b72e2beab68.tar.gz |
Merge pull request #531 from mcuadros/ref-name
plumbing: moved `Reference.Is*` methods to `ReferenceName.Is*`
Diffstat (limited to 'worktree.go')
-rw-r--r-- | worktree.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/worktree.go b/worktree.go index 60c8adb..4f8e740 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()) } |