aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--storage/filesystem/internal/dotgit/dotgit_setref_norwfs.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/storage/filesystem/internal/dotgit/dotgit_setref_norwfs.go b/storage/filesystem/internal/dotgit/dotgit_setref_norwfs.go
index b22166c..8b1e662 100644
--- a/storage/filesystem/internal/dotgit/dotgit_setref_norwfs.go
+++ b/storage/filesystem/internal/dotgit/dotgit_setref_norwfs.go
@@ -4,6 +4,13 @@ package dotgit
import "gopkg.in/src-d/go-git.v4/plumbing"
+// There are some filesystems tha don't support opening files in RDWD mode.
+// In these filesystems the standard SetRef function can not be used as i
+// reads the reference file to check that it's not modified before updating it.
+//
+// This version of the function writes the reference without extra checks
+// making it compatible with these simple filesystems. This is usually not
+// a problem as they should be accessed by only one process at a time.
func (d *DotGit) setRef(fileName, content string, old *plumbing.Reference) error {
f, err := d.fs.Create(fileName)
if err != nil {