aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/change_adaptor.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/object/change_adaptor.go')
-rw-r--r--plumbing/object/change_adaptor.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/plumbing/object/change_adaptor.go b/plumbing/object/change_adaptor.go
index cf8de6c..49b6545 100644
--- a/plumbing/object/change_adaptor.go
+++ b/plumbing/object/change_adaptor.go
@@ -1,6 +1,7 @@
package object
import (
+ "errors"
"fmt"
"gopkg.in/src-d/go-git.v4/utils/merkletrie"
@@ -15,11 +16,11 @@ func newChange(c merkletrie.Change) (*Change, error) {
var err error
if ret.From, err = newChangeEntry(c.From); err != nil {
- return nil, fmt.Errorf("From field: ", err)
+ return nil, fmt.Errorf("From field: %s", err)
}
if ret.To, err = newChangeEntry(c.To); err != nil {
- return nil, fmt.Errorf("To field: ", err)
+ return nil, fmt.Errorf("To field: %s", err)
}
return ret, nil
@@ -32,7 +33,7 @@ func newChangeEntry(p noder.Path) (ChangeEntry, error) {
asTreeNoder, ok := p.Last().(*treeNoder)
if !ok {
- return ChangeEntry{}, fmt.Errorf("cannot transform non-TreeNoders")
+ return ChangeEntry{}, errors.New("cannot transform non-TreeNoders")
}
return ChangeEntry{
@@ -52,7 +53,7 @@ func newChanges(src merkletrie.Changes) (Changes, error) {
for i, e := range src {
ret[i], err = newChange(e)
if err != nil {
- return nil, fmt.Errorf("change #%d: %s", err)
+ return nil, fmt.Errorf("change #%d: %s", i, err)
}
}