087db1de70
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'
27 lines
648 B
Go
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()
|
|
}
|