Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit dae8c68

Browse files
committed
Add comment to the norwfs version of SetRef
Signed-off-by: Javi Fontan <jfontan@gmail.com>
1 parent 8d28840 commit dae8c68

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

storage/filesystem/internal/dotgit/dotgit_setref_norwfs.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ package dotgit
44

55
import "gopkg.in/src-d/go-git.v4/plumbing"
66

7+
// There are some filesystems tha don't support opening files in RDWD mode.
8+
// In these filesystems the standard SetRef function can not be used as i
9+
// reads the reference file to check that it's not modified before updating it.
10+
//
11+
// This version of the function writes the reference without extra checks
12+
// making it compatible with these simple filesystems. This is usually not
13+
// a problem as they should be accessed by only one process at a time.
714
func (d *DotGit) setRef(fileName, content string, old *plumbing.Reference) error {
815
f, err := d.fs.Create(fileName)
916
if err != nil {

0 commit comments

Comments
 (0)