Browse Source

[annex] Repeated web upload for annexed file

annexed files, on clone, are dangling symlinks which need to be removed before we can write to them again.
cgars 7 năm trước cách đây
mục cha
commit
d3279c4da8
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      models/repo_editor.go

+ 2 - 0
models/repo_editor.go

@@ -527,6 +527,8 @@ func (repo *Repository) UploadRepoFiles(doer *User, opts UploadRepoFileOptions)
 		if !com.IsFile(tmpPath) {
 			continue
 		}
+		// needed for annex, due to symlinks
+		os.Remove(targetPath)
 		if err = com.Copy(tmpPath, targetPath); err != nil {
 			return fmt.Errorf("copy: %v", err)
 		}