aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-29 05:56:51 +0000
committerGravatar Runxi Yu2026-03-29 05:56:51 +0000
commit9bd37998c9ea890401b66604806f7d1fe06b9256 (patch)
treefcfe8439d374702a2527bb43c4b3555c541e9a15
parentREADME: Repository gets new methods (diff)
signatureNo signature
*: Repeated calls to Close are UB by default v0.1.132
-rw-r--r--format/commitgraph/read/close.go2
-rw-r--r--furgit.go3
-rw-r--r--object/store/loose/write_writer_finalize.go2
-rw-r--r--object/store/reading.go2
-rw-r--r--ref/store/reading.go2
5 files changed, 2 insertions, 9 deletions
diff --git a/format/commitgraph/read/close.go b/format/commitgraph/read/close.go
index 8fd1bbf2..d91c7762 100644
--- a/format/commitgraph/read/close.go
+++ b/format/commitgraph/read/close.go
@@ -1,8 +1,6 @@
package read
// Close releases all mapped commit-graph files.
-//
-// Labels: Close-UB.
func (reader *Reader) Close() error {
var closeErr error
diff --git a/furgit.go b/furgit.go
index e724ed8b..a43f6d40 100644
--- a/furgit.go
+++ b/furgit.go
@@ -40,7 +40,8 @@
// - Close-Caller: the caller must close the returned value.
// - Close-No: the caller must not close the returned value directly.
// - Close-Idem: repeated Close calls are safe.
-// - Close-UB: repeated Close calls are undefined behavior.
+//
+// Unless Close-Idem is specified, repeated Close calls are undefined behavior.
//
// Unless a doc comment explicitly states otherwise, these labels describe the
// API contract only. They do not imply any specific implementation strategy.
diff --git a/object/store/loose/write_writer_finalize.go b/object/store/loose/write_writer_finalize.go
index f8dee54d..3a85794e 100644
--- a/object/store/loose/write_writer_finalize.go
+++ b/object/store/loose/write_writer_finalize.go
@@ -9,8 +9,6 @@ import (
)
// Close flushes and closes the underlying zlib stream and temp file.
-//
-// Repeated calls to Close are undefined behavior.
func (writer *streamWriter) Close() error {
errZlib := writer.zw.Close()
errSync := writer.file.Sync()
diff --git a/object/store/reading.go b/object/store/reading.go
index 0c6eff18..9a487bcf 100644
--- a/object/store/reading.go
+++ b/object/store/reading.go
@@ -54,7 +54,5 @@ type ReadingStore interface {
Refresh() error
// Close releases resources associated with the backend.
- //
- // Labels: Close-UB.
Close() error
}
diff --git a/ref/store/reading.go b/ref/store/reading.go
index ff8ac6f7..66528127 100644
--- a/ref/store/reading.go
+++ b/ref/store/reading.go
@@ -34,7 +34,5 @@ type ReadingStore interface {
// Close releases resources associated with the store.
//
// Transactions and batches borrowing the store are invalid after Close.
- //
- // Labels: Close-UB.
Close() error
}