Skip to content

Commit f4b5329

Browse files
committed
Fix symbolic link sync problem & upstream ignore problem
1 parent 3712344 commit f4b5329

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

pkg/devspace/sync/evaluater.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func shouldUpload(relativePath string, stat os.FileInfo, s *SyncConfig, isInitia
4949

5050
// Exclude changes on the upload exclude list
5151
// if s.uploadIgnoreMatcher != nil {
52-
// if s.uploadIgnoreMatcher.MatchesPath(relativePath) {
52+
// if s.uploadIgnoreMatcher.MatchesPath(relativePath) {
5353
// return false
5454
// }
5555
// }

pkg/devspace/sync/file_information.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (p parsingError) Error() string {
5656
}
5757

5858
func getFindCommand(destPath string) string {
59-
return "mkdir -p '" + destPath + "' && find '" + destPath + "' -exec stat -c \"%n///%s,%Y,%f,%a,%u,%g\" {} + 2>/dev/null && echo -n \"" + EndAck + "\" || echo \"" + ErrorAck + "\"\n"
59+
return "mkdir -p '" + destPath + "' && find -L '" + destPath + "' -exec stat -c \"%n///%s,%Y,%f,%a,%u,%g\" {} + 2>/dev/null && echo -n \"" + EndAck + "\" || echo \"" + ErrorAck + "\"\n"
6060
}
6161

6262
func parseFileInformation(fileline, destPath string) (*fileInformation, error) {

pkg/devspace/sync/sync_config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,10 @@ func (s *SyncConfig) diffServerClient(filepath string, sendChanges *[]*fileInfor
293293

294294
delete(downloadChanges, relativePath)
295295

296-
s.fileIndex.fileMapMutex.Lock()
297296
// Exclude changes on the upload exclude list
298297
if s.uploadIgnoreMatcher != nil {
299298
if s.uploadIgnoreMatcher.MatchesPath(relativePath) {
299+
s.fileIndex.fileMapMutex.Lock()
300300
// Add to file map and prevent download if local file is newer than the remote one
301301
if s.fileIndex.fileMap[relativePath] != nil && s.fileIndex.fileMap[relativePath].Mtime < ceilMtime(stat.ModTime()) {
302302
// Add it to the fileMap
@@ -307,11 +307,13 @@ func (s *SyncConfig) diffServerClient(filepath string, sendChanges *[]*fileInfor
307307
IsDirectory: stat.IsDir(),
308308
}
309309
}
310+
s.fileIndex.fileMapMutex.Unlock()
310311

311312
return nil
312313
}
313314
}
314315

316+
s.fileIndex.fileMapMutex.Lock()
315317
shouldUpload := shouldUpload(relativePath, stat, s, true)
316318
s.fileIndex.fileMapMutex.Unlock()
317319

@@ -343,7 +345,7 @@ func (s *SyncConfig) diffDir(filepath string, stat os.FileInfo, sendChanges *[]*
343345
return nil
344346
}
345347

346-
if len(files) == 0 {
348+
if len(files) == 0 && relativePath != "" {
347349
*sendChanges = append(*sendChanges, &fileInformation{
348350
Name: relativePath,
349351
Mtime: ceilMtime(stat.ModTime()),

0 commit comments

Comments
 (0)