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

Add a setRef and rewritePackedRefsWhileLocked versions that supports non rw fs #700

Merged

Conversation

jfontan
Copy link
Contributor

@jfontan jfontan commented Dec 21, 2017

There are some filesystems that do not support opening the files in read
and write modes at the same time. The method SetRef is split in files with
an extra version that only writes the reference. It can be activated with
-tags norwfs on building.

There are some filesystems that do not support opening the files in read
and write modes at the same time. The method SetRef is split in files with
an extra version that only writes the reference. It can be activated with
-tags norwfs on building.

Signed-off-by: Javi Fontan <[email protected]>

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

func (d *DotGit) setRef(fileName, content string, old *plumbing.Reference) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some comments here explaining the reason of this method (like on the PR description)?

@jfontan
Copy link
Contributor Author

jfontan commented Dec 22, 2017

Do not merge. There are still some changes needed to make it fully compatible.

@jfontan jfontan changed the title Add a setRef version that supports non rw fs [WIP] Add a setRef version that supports non rw fs Dec 22, 2017
@jfontan jfontan changed the title [WIP] Add a setRef version that supports non rw fs Add a setRef and rewritePackedRefsWhileLocked versions that supports non rw fs Dec 22, 2017
@jfontan
Copy link
Contributor Author

jfontan commented Dec 22, 2017

The implementation is ready. Tests also pass with go test -tags norwfs ./....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants