@cryptotaxi247 / kubo / commits / 384ca525b

Clean up fsrepo path handling

Tommi Virtanen committed Mar 13, 2015 at 16:02 UTC 384ca525b4178a3eb7447a7f8c9dfcd3dbbbf5b1
1 file changed +4 -9
repo/fsrepo/fsrepo.go
+4 -9
@@ -80,20 +80,15 @@ func open(repoPath string) (repo.Repo, error) {
80 packageLock.Lock()
81 defer packageLock.Unlock()
82
83 - r := &FSRepo{
84 - path: path.Clean(repoPath),
85 - state: unopened, // explicitly set for clarity
86 - }
87 -
88 - expPath, err := u.TildeExpansion(r.path)
83 + expPath, err := u.TildeExpansion(path.Clean(repoPath))
84 if err != nil {
85 return nil, err
86 }
92 - r.path = expPath
87
94 - if r.state != unopened {
95 - return nil, debugerror.Errorf("repo is %s", r.state)
88 + r := &FSRepo{
89 + path: expPath,
90 }
91 +
92 if !isInitializedUnsynced(r.path) {
93 return nil, debugerror.New("ipfs not initialized, please run 'ipfs init'")
94 }