aboutsummaryrefslogtreecommitdiffstats
path: root/common.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-14 23:12:44 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-12-14 23:12:44 +0100
commit0af572dd21c0aa79d13745b633ee24ba6c4d6cf1 (patch)
tree49e81e74e82d84fd88b2fc1e4b0dc7c7bfe9c40f /common.go
parentdf0f38af83f972f026d7e14150f3d37b95f13484 (diff)
downloadgo-git-0af572dd21c0aa79d13745b633ee24ba6c4d6cf1.tar.gz
move plumbing from top level package to plumbing (#183)
* plumbing: rename Object -> EncodedObject. * plumbing/storer: rename ObjectStorer -> EncodedObjectStorer. * move difftree to plumbing/difftree. * move diff -> utils/diff * make Object/Tag/Blob/Tree/Commit/File depend on storer. * Object and its implementations now depend only on storer.EncodedObjectStorer, not git.Repository. * Tests are decoupled accordingly. * move Object/Commit/File/Tag/Tree to plumbing/object. * move Object/Commit/File/Tag/Tree to plumbing/object. * move checkClose to utils/ioutil. * move RevListObjects to plumbing/revlist.Objects. * move DiffTree to plumbing/difftree package. * rename files with plural nouns to singular * plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.
Diffstat (limited to 'common.go')
-rw-r--r--common.go26
1 files changed, 1 insertions, 25 deletions
diff --git a/common.go b/common.go
index aee932f..9c642ed 100644
--- a/common.go
+++ b/common.go
@@ -1,7 +1,6 @@
package git
import (
- "io"
"strings"
"gopkg.in/src-d/go-git.v4/config"
@@ -13,7 +12,7 @@ import (
// information in an system directory (such as `.git`) and others
// implementations are in memmory being ephemeral
type Storer interface {
- storer.ObjectStorer
+ storer.EncodedObjectStorer
storer.ReferenceStorer
config.ConfigStorer
}
@@ -34,26 +33,3 @@ func countLines(s string) int {
return nEOL + 1
}
-
-// checkClose is used with defer to close the given io.Closer and check its
-// returned error value. If Close returns an error and the given *error
-// is not nil, *error is set to the error returned by Close.
-//
-// checkClose is typically used with named return values like so:
-//
-// func do(obj *Object) (err error) {
-// w, err := obj.Writer()
-// if err != nil {
-// return nil
-// }
-// defer checkClose(w, &err)
-// // work with w
-// }
-func checkClose(c io.Closer, err *error) {
- if cerr := c.Close(); cerr != nil && *err == nil {
- *err = cerr
- }
-}
-
-// DateFormat is the format being use in the orignal git implementation
-const DateFormat = "Mon Jan 02 15:04:05 2006 -0700"