Skip to content

Commit

Permalink
list: traverse nested dir symlinks
Browse files Browse the repository at this point in the history
Addresses issue odeke-em#80 and fixes commit 7f7dea5. The proper path of the symlink is now used
  • Loading branch information
geniass committed Mar 12, 2015
1 parent 7f7dea5 commit d5da3ff
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,11 @@ func list(context *config.Context, p string, hidden bool, ignore *regexp.Regexp)

symlink := (file.Mode() & os.ModeSymlink) != 0
if symlink {
fChan, cErr := list(context, gopath.Join(p, file.Name()), hidden, ignore)
if cErr != nil {
continue
}
for child := range fChan {
fileChan <- child
}
var s string
s, err = filepath.EvalSymlinks(gopath.Join(absPath, file.Name()))
var sym_file os.FileInfo
sym_file, err = os.Stat(s)
fileChan <- NewLocalFile(gopath.Join(absPath, file.Name()), sym_file)
}
}
close(fileChan)
Expand Down

0 comments on commit d5da3ff

Please sign in to comment.