aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd_windows.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd_windows.go b/cmd_windows.go
index f722b47..23f75bd 100644
--- a/cmd_windows.go
+++ b/cmd_windows.go
@@ -319,13 +319,17 @@ func scanDirectory(root string, stack *GitignoreStack) *Manifest {
return manifest
}
+func normalizePath(p string) string {
+ return filepath.ToSlash(p)
+}
+
func sendManifest(conn net.Conn, manifest *Manifest) error {
const batchSize = 1000
files := make([]FileMetaJSON, 0, batchSize)
paths := make([]string, 0, batchSize)
for path, meta := range manifest.ToJSON() {
- paths = append(paths, path)
+ paths = append(paths, normalizePath(path))
files = append(files, meta)
if len(files) >= batchSize {
@@ -378,7 +382,7 @@ func sendManifest(conn net.Conn, manifest *Manifest) error {
}
func sendEvent(conn net.Conn, evt FileEvent) error {
- msg := &ProtocolMessage{Path: evt.Path}
+ msg := &ProtocolMessage{Path: normalizePath(evt.Path)}
switch evt.Op {
case "create":
msg.Type = "event_create"