aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/internal
diff options
context:
space:
mode:
authorJavi Fontan <jfontan@gmail.com>2017-12-21 13:06:56 +0100
committerJavi Fontan <jfontan@gmail.com>2017-12-21 13:08:31 +0100
commitdae8c68b753943058aa397947e5c318d8db8cab8 (patch)
tree6d9cf741228c3c4b441faaa4fd7b7689140fcae6 /storage/filesystem/internal
parent8d288404016a90c9b17dd8230db2c5da1a1ccfe5 (diff)
downloadgo-git-dae8c68b753943058aa397947e5c318d8db8cab8.tar.gz
Add comment to the norwfs version of SetRef
Signed-off-by: Javi Fontan <jfontan@gmail.com>
Diffstat (limited to 'storage/filesystem/internal')
-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 {