From 45dfd616cb4b7326ec41202468e875d1e4b2c6d7 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 14 Jul 2014 23:58:37 +0200 Subject: [PATCH] Pick up dirs without a CurrentFiler --- scanner/walk.go | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/scanner/walk.go b/scanner/walk.go index 516b99e28..3c0a20c13 100644 --- a/scanner/walk.go +++ b/scanner/walk.go @@ -176,26 +176,27 @@ func (w *Walker) walkAndHashFiles(res *[]protocol.FileInfo, ign map[string][]str l.Debugln("unchanged:", cf) } *res = append(*res, cf) - } else { - var flags uint32 = protocol.FlagDirectory - if w.IgnorePerms { - flags |= protocol.FlagNoPermBits | 0777 - } else { - flags |= uint32(info.Mode() & os.ModePerm) - } - f := protocol.FileInfo{ - Name: rn, - Version: lamport.Default.Tick(0), - Flags: flags, - Modified: info.ModTime().Unix(), - } - if debug { - l.Debugln("dir:", cf, f) - } - *res = append(*res, f) + return nil } - return nil } + + var flags uint32 = protocol.FlagDirectory + if w.IgnorePerms { + flags |= protocol.FlagNoPermBits | 0777 + } else { + flags |= uint32(info.Mode() & os.ModePerm) + } + f := protocol.FileInfo{ + Name: rn, + Version: lamport.Default.Tick(0), + Flags: flags, + Modified: info.ModTime().Unix(), + } + if debug { + l.Debugln("dir:", f) + } + *res = append(*res, f) + return nil } if info.Mode().IsRegular() {