Skip to content

Commit d447e56

Browse files
author
githubnemo
committed
Fix #23
* `-exclude-dir=./foo` was not equal to `.exclude-dir=foo` which should be fixed now by using `filepath.Clean()` on each exclude. The same holds true for `-include` since both use the same `globList` * `info.Name()` was used for glob matching instead of the complete file path resulting in `-exclude-dir=.git/objects` matching against `objects` instead of `.git/objects`.
1 parent d8c4bf1 commit d447e56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

daemon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (g *globList) String() string {
9191
return fmt.Sprint(*g)
9292
}
9393
func (g *globList) Set(value string) error {
94-
*g = append(*g, value)
94+
*g = append(*g, filepath.Clean(value))
9595
return nil
9696
}
9797
func (g *globList) Matches(value string) bool {
@@ -383,7 +383,7 @@ func main() {
383383
if *flag_recursive == true {
384384
err = filepath.Walk(*flag_directory, func(path string, info os.FileInfo, err error) error {
385385
if err == nil && info.IsDir() {
386-
if flag_excludedDirs.Matches(info.Name()) {
386+
if flag_excludedDirs.Matches(path) {
387387
return filepath.SkipDir
388388
} else {
389389
if *flag_verbose {

0 commit comments

Comments
 (0)