git-lfs/lfs/gitfilter.go
brian m. carlson 087db1de70
Set package version to v3
Since we're about to do a v3.0.0 release, let's bump the version to v3.

Make this change automatically with the following command to avoid any
missed items:

  git grep -l github.com/git-lfs/git-lfs/v2 | \
  xargs sed -i -e 's!github.com/git-lfs/git-lfs/v2!github.com/git-lfs/git-lfs/v3!g'
2021-09-02 20:41:08 +00:00

27 lines
648 B
Go

package lfs
import (
"github.com/git-lfs/git-lfs/v3/config"
"github.com/git-lfs/git-lfs/v3/fs"
"github.com/git-lfs/git-lfs/v3/git"
)
// GitFilter provides clean and smudge capabilities
type GitFilter struct {
cfg *config.Configuration
fs *fs.Filesystem
}
// NewGitFilter initializes a new *GitFilter
func NewGitFilter(cfg *config.Configuration) *GitFilter {
return &GitFilter{cfg: cfg, fs: cfg.Filesystem()}
}
func (f *GitFilter) ObjectPath(oid string) (string, error) {
return f.fs.ObjectPath(oid)
}
func (f *GitFilter) RemoteRef() *git.Ref {
return git.NewRefUpdate(f.cfg.Git, f.cfg.PushRemote(), f.cfg.CurrentRef(), nil).Right()
}