aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/dotgit/dotgit.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2018-06-15 17:20:51 +0200
committerSantiago M. Mola <santi@mola.io>2018-06-21 14:31:05 +0200
commitda5d474fb43dffd1b28cd5662b3a5bf7e446cd5c (patch)
treee567118cfe531ab340c9ffa96c5db405b9d02ea8 /storage/filesystem/dotgit/dotgit.go
parentb11eaabdfd82deb68537fd44176d58084a6f367d (diff)
downloadgo-git-da5d474fb43dffd1b28cd5662b3a5bf7e446cd5c.tar.gz
storage/filesystem: avoid norwfs build flag
norwfs build flag was used to work on filesystems that do not support neither opening a file in read/write mode or renaming a file (e.f. sivafs). This had two problems: - go-git could not be compiled to work properly both with regular filesystems and limited filesystems at the same time. - the norwfs trick was not available on Windows. This PR removes the norwfs build flag, as well as the windows conditional flag on the dotgit package. For the file open mode, we use the new billy capabilities, to check at runtime if the filesystem supports opening a file in read/write mode or not. For the renaming, we just try and fallback to alternative methods if billy.ErrNotSupported is returned. Signed-off-by: Santiago M. Mola <santi@mola.io>
Diffstat (limited to 'storage/filesystem/dotgit/dotgit.go')
-rw-r--r--storage/filesystem/dotgit/dotgit.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/filesystem/dotgit/dotgit.go b/storage/filesystem/dotgit/dotgit.go
index 52b621c..dc12f23 100644
--- a/storage/filesystem/dotgit/dotgit.go
+++ b/storage/filesystem/dotgit/dotgit.go
@@ -469,7 +469,7 @@ func (d *DotGit) openAndLockPackedRefs(doCreate bool) (
// File mode is retrieved from a constant defined in the target specific
// files (dotgit_rewrite_packed_refs_*). Some modes are not available
// in all filesystems.
- openFlags := openAndLockPackedRefsMode
+ openFlags := d.openAndLockPackedRefsMode()
if doCreate {
openFlags |= os.O_CREATE
}