aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 11:27:11 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-30 11:27:11 +0100
commitd24e1e9a69c2082763db51959121d3936e621658 (patch)
treec78f9b87e4edb278e4709d9d0b0282e43423031a /repository.go
parenta052498f23198ad1f2e9ca8f9943d2a48e274c06 (diff)
downloadgo-git-d24e1e9a69c2082763db51959121d3936e621658.tar.gz
Repository.Worktree, removing custom fs
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/repository.go b/repository.go
index c49042f..82ebb0c 100644
--- a/repository.go
+++ b/repository.go
@@ -472,7 +472,7 @@ func (r *Repository) updateWorktree() error {
return nil
}
- w, err := r.Worktree(nil)
+ w, err := r.Worktree()
if err != nil {
return err
}
@@ -625,14 +625,10 @@ func (r *Repository) References() (storer.ReferenceIter, error) {
// Worktree returns a worktree based on the given fs, if nil the default
// worktree will be used.
-func (r *Repository) Worktree(fs billy.Filesystem) (*Worktree, error) {
- if r.wt == nil && fs == nil {
+func (r *Repository) Worktree() (*Worktree, error) {
+ if r.wt == nil {
return nil, ErrIsBareRepository
}
- if fs == nil {
- fs = r.wt
- }
-
- return &Worktree{r: r, fs: fs}, nil
+ return &Worktree{r: r, fs: r.wt}, nil
}