aboutsummaryrefslogtreecommitdiff
path: root/object/commit/append.go
diff options
context:
space:
mode:
Diffstat (limited to 'object/commit/append.go')
-rw-r--r--object/commit/append.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/object/commit/append.go b/object/commit/append.go
index 8da33383..2bc00573 100644
--- a/object/commit/append.go
+++ b/object/commit/append.go
@@ -1,7 +1,6 @@
package commit
import (
- "errors"
"fmt"
"codeberg.org/lindenii/furgit/object/header"
@@ -10,10 +9,6 @@ import (
// AppendWithoutHeader renders the raw commit body bytes.
func (commit *Commit) AppendWithoutHeader(dst []byte) ([]byte, error) {
- if commit.Tree.Algorithm().Size() == 0 {
- return dst, errors.New("object: commit: missing tree id")
- }
-
dst = fmt.Appendf(dst, "tree %s\n", commit.Tree.String())
for _, parent := range commit.Parents {
@@ -35,9 +30,7 @@ func (commit *Commit) AppendWithoutHeader(dst []byte) ([]byte, error) {
}
for _, h := range commit.ExtraHeaders {
- if h.Key == "" {
- return dst, errors.New("object: commit: extra header has empty key")
- }
+ // GIGO on empty keys and such.
dst = append(dst, []byte(h.Key)...)
dst = append(dst, byte(' '))