From dae8c68b753943058aa397947e5c318d8db8cab8 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 21 Dec 2017 13:06:56 +0100 Subject: Add comment to the norwfs version of SetRef Signed-off-by: Javi Fontan --- storage/filesystem/internal/dotgit/dotgit_setref_norwfs.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'storage/filesystem/internal') 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 { -- cgit