aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-05-11 21:34:07 +0100
committerPaulo Gomes <pjbgf@linux.com>2023-05-11 21:34:07 +0100
commit9dfaf6acd8e3aa1c85bcce7d45f8e8c6b908319c (patch)
tree58e4dc8c6b2071259eba56169ece9e4cf2c3c93c /plumbing/format
parentdc2b346ed149080199d578f0190f3ac1156480c2 (diff)
downloadgo-git-9dfaf6acd8e3aa1c85bcce7d45f8e8c6b908319c.tar.gz
*: Remove redudant err nil checks
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
Diffstat (limited to 'plumbing/format')
-rw-r--r--plumbing/format/idxfile/writer.go5
-rw-r--r--plumbing/format/packfile/encoder.go6
2 files changed, 2 insertions, 9 deletions
diff --git a/plumbing/format/idxfile/writer.go b/plumbing/format/idxfile/writer.go
index daa1605..e556013 100644
--- a/plumbing/format/idxfile/writer.go
+++ b/plumbing/format/idxfile/writer.go
@@ -84,11 +84,8 @@ func (w *Writer) OnFooter(h plumbing.Hash) error {
w.checksum = h
w.finished = true
_, err := w.createIndex()
- if err != nil {
- return err
- }
- return nil
+ return err
}
// creatIndex returns a filled MemoryIndex with the information filled by
diff --git a/plumbing/format/packfile/encoder.go b/plumbing/format/packfile/encoder.go
index c9d19b3..804f5a8 100644
--- a/plumbing/format/packfile/encoder.go
+++ b/plumbing/format/packfile/encoder.go
@@ -131,11 +131,7 @@ func (e *Encoder) entry(o *ObjectToPack) (err error) {
defer ioutil.CheckClose(or, &err)
_, err = io.Copy(e.zw, or)
- if err != nil {
- return err
- }
-
- return nil
+ return err
}
func (e *Encoder) writeBaseIfDelta(o *ObjectToPack) error {