aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/internal/dotgit/dotgit.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/filesystem/internal/dotgit/dotgit.go')
-rw-r--r--storage/filesystem/internal/dotgit/dotgit.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/storage/filesystem/internal/dotgit/dotgit.go b/storage/filesystem/internal/dotgit/dotgit.go
index f3a2308..9bbf4e8 100644
--- a/storage/filesystem/internal/dotgit/dotgit.go
+++ b/storage/filesystem/internal/dotgit/dotgit.go
@@ -253,10 +253,10 @@ func (d *DotGit) SetRef(r *plumbing.Reference) error {
return err
}
- if _, err := f.Write([]byte(content)); err != nil {
- return err
- }
- return f.Close()
+ defer ioutil.CheckClose(f, &err)
+
+ _, err = f.Write([]byte(content))
+ return err
}
// Refs scans the git directory collecting references, which it returns.