aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/refspec.go2
-rw-r--r--plumbing/format/index/decoder.go2
-rw-r--r--plumbing/transport/common_test.go20
-rw-r--r--prune.go2
-rw-r--r--status.go2
5 files changed, 19 insertions, 9 deletions
diff --git a/config/refspec.go b/config/refspec.go
index c9b9d52..391705c 100644
--- a/config/refspec.go
+++ b/config/refspec.go
@@ -15,7 +15,7 @@ const (
var (
ErrRefSpecMalformedSeparator = errors.New("malformed refspec, separators are wrong")
- ErrRefSpecMalformedWildcard = errors.New("malformed refspec, missmatched number of wildcards")
+ ErrRefSpecMalformedWildcard = errors.New("malformed refspec, mismatched number of wildcards")
)
// RefSpec is a mapping from local branches to remote references
diff --git a/plumbing/format/index/decoder.go b/plumbing/format/index/decoder.go
index 1a58128..df25530 100644
--- a/plumbing/format/index/decoder.go
+++ b/plumbing/format/index/decoder.go
@@ -21,7 +21,7 @@ var (
// ErrMalformedSignature is returned by Decode when the index header file is
// malformed
ErrMalformedSignature = errors.New("malformed index signature file")
- // ErrInvalidChecksum is returned by Decode if the SHA1 hash missmatch with
+ // ErrInvalidChecksum is returned by Decode if the SHA1 hash mismatch with
// the read content
ErrInvalidChecksum = errors.New("invalid checksum")
diff --git a/plumbing/transport/common_test.go b/plumbing/transport/common_test.go
index 17f62a6..65ed5b9 100644
--- a/plumbing/transport/common_test.go
+++ b/plumbing/transport/common_test.go
@@ -1,6 +1,7 @@
package transport
import (
+ "fmt"
"net/url"
"testing"
@@ -155,12 +156,21 @@ func (s *SuiteCommon) TestNewEndpointFileURL(c *C) {
}
func (s *SuiteCommon) TestValidEndpoint(c *C) {
- e, err := NewEndpoint("http://github.com/user/repository.git")
- e.User = "person@mail.com"
- e.Password = " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
- url, err := url.Parse(e.String())
+ user := "person@mail.com"
+ pass := " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
+ e, err := NewEndpoint(fmt.Sprintf(
+ "http://%s:%s@github.com/user/repository.git",
+ url.PathEscape(user),
+ url.PathEscape(pass),
+ ))
c.Assert(err, IsNil)
- c.Assert(url, NotNil)
+ c.Assert(e, NotNil)
+ c.Assert(e.User, Equals, user)
+ c.Assert(e.Password, Equals, pass)
+ c.Assert(e.Host, Equals, "github.com")
+ c.Assert(e.Path, Equals, "/user/repository.git")
+
+ c.Assert(e.String(), Equals, "http://person@mail.com:%20%21%22%23$%25&%27%28%29%2A+%2C-.%2F:%3B%3C=%3E%3F@%5B%5C%5D%5E_%60%7B%7C%7D~@github.com/user/repository.git")
}
func (s *SuiteCommon) TestNewEndpointInvalidURL(c *C) {
diff --git a/prune.go b/prune.go
index 04913d6..c840325 100644
--- a/prune.go
+++ b/prune.go
@@ -49,7 +49,7 @@ func (r *Repository) Prune(opt PruneOptions) error {
}
// Otherwise it is a candidate for pruning.
// Check out for too new objects next.
- if opt.OnlyObjectsOlderThan != (time.Time{}) {
+ if !opt.OnlyObjectsOlderThan.IsZero() {
// Errors here are non-fatal. The object may be e.g. packed.
// Or concurrently deleted. Skip such objects.
t, err := los.LooseObjectTime(hash)
diff --git a/status.go b/status.go
index ecbf793..7f18e02 100644
--- a/status.go
+++ b/status.go
@@ -26,7 +26,7 @@ func (s Status) IsUntracked(path string) bool {
return ok && stat.Worktree == Untracked
}
-// IsClean returns true if all the files aren't in Unmodified status.
+// IsClean returns true if all the files are in Unmodified status.
func (s Status) IsClean() bool {
for _, status := range s {
if status.Worktree != Unmodified || status.Staging != Unmodified {