diff options
Diffstat (limited to 'plumbing')
-rw-r--r-- | plumbing/format/commitgraph/file.go | 2 | ||||
-rw-r--r-- | plumbing/format/commitgraph/memory.go | 2 | ||||
-rw-r--r-- | plumbing/format/idxfile/writer.go | 2 | ||||
-rw-r--r-- | plumbing/object/patch.go | 2 | ||||
-rw-r--r-- | plumbing/object/tree.go | 4 | ||||
-rw-r--r-- | plumbing/protocol/packp/advrefs.go | 2 | ||||
-rw-r--r-- | plumbing/protocol/packp/updreq_decode.go | 2 | ||||
-rw-r--r-- | plumbing/transport/ssh/auth_method.go | 2 |
8 files changed, 9 insertions, 9 deletions
diff --git a/plumbing/format/commitgraph/file.go b/plumbing/format/commitgraph/file.go index 175d279..1f82abd 100644 --- a/plumbing/format/commitgraph/file.go +++ b/plumbing/format/commitgraph/file.go @@ -249,7 +249,7 @@ func (fi *fileIndex) getHashesFromIndexes(indexes []int) ([]plumbing.Hash, error // Hashes returns all the hashes that are available in the index
func (fi *fileIndex) Hashes() []plumbing.Hash {
hashes := make([]plumbing.Hash, fi.fanout[0xff])
- for i := 0; i < int(fi.fanout[0xff]); i++ {
+ for i := 0; i < fi.fanout[0xff]; i++ {
offset := fi.oidLookupOffset + int64(i)*20
if n, err := fi.reader.ReadAt(hashes[i][:], offset); err != nil || n < 20 {
return nil
diff --git a/plumbing/format/commitgraph/memory.go b/plumbing/format/commitgraph/memory.go index a4a96e9..f5afd4c 100644 --- a/plumbing/format/commitgraph/memory.go +++ b/plumbing/format/commitgraph/memory.go @@ -31,7 +31,7 @@ func (mi *MemoryIndex) GetIndexByHash(h plumbing.Hash) (int, error) { // GetCommitDataByIndex gets the commit node from the commit graph using index
// obtained from child node, if available
func (mi *MemoryIndex) GetCommitDataByIndex(i int) (*CommitData, error) {
- if int(i) >= len(mi.commitData) {
+ if i >= len(mi.commitData) {
return nil, plumbing.ErrObjectNotFound
}
diff --git a/plumbing/format/idxfile/writer.go b/plumbing/format/idxfile/writer.go index aa919e7..fcc78c5 100644 --- a/plumbing/format/idxfile/writer.go +++ b/plumbing/format/idxfile/writer.go @@ -147,7 +147,7 @@ func (w *Writer) createIndex() (*MemoryIndex, error) { idx.Offset32[bucket] = append(idx.Offset32[bucket], buf.Bytes()...) buf.Truncate(0) - binary.WriteUint32(buf, uint32(o.CRC32)) + binary.WriteUint32(buf, o.CRC32) idx.CRC32[bucket] = append(idx.CRC32[bucket], buf.Bytes()...) } diff --git a/plumbing/object/patch.go b/plumbing/object/patch.go index 1efd0b1..32454ac 100644 --- a/plumbing/object/patch.go +++ b/plumbing/object/patch.go @@ -278,7 +278,7 @@ func printStat(fileStats []FileStat) string { var scaleFactor float64 if longestTotalChange > heightOfHistogram { // Scale down to heightOfHistogram. - scaleFactor = float64(longestTotalChange / heightOfHistogram) + scaleFactor = longestTotalChange / heightOfHistogram } else { scaleFactor = 1.0 } diff --git a/plumbing/object/tree.go b/plumbing/object/tree.go index d30cf6e..d0b4fff 100644 --- a/plumbing/object/tree.go +++ b/plumbing/object/tree.go @@ -288,7 +288,7 @@ func (t *Tree) Encode(o plumbing.EncodedObject) (err error) { return err } - if _, err = w.Write([]byte(entry.Hash[:])); err != nil { + if _, err = w.Write(entry.Hash[:]); err != nil { return err } } @@ -517,4 +517,4 @@ func simpleJoin(parent, child string) string { return parent + "/" + child } return child -}
\ No newline at end of file +} diff --git a/plumbing/protocol/packp/advrefs.go b/plumbing/protocol/packp/advrefs.go index 684e76a..487ee19 100644 --- a/plumbing/protocol/packp/advrefs.go +++ b/plumbing/protocol/packp/advrefs.go @@ -107,7 +107,7 @@ func (a *AdvRefs) resolveHead(s storer.ReferenceStorer) error { return nil } - ref, err := s.Reference(plumbing.ReferenceName(plumbing.Master)) + ref, err := s.Reference(plumbing.Master) // check first if HEAD is pointing to master if err == nil { diff --git a/plumbing/protocol/packp/updreq_decode.go b/plumbing/protocol/packp/updreq_decode.go index c15d49c..51e8183 100644 --- a/plumbing/protocol/packp/updreq_decode.go +++ b/plumbing/protocol/packp/updreq_decode.go @@ -225,7 +225,7 @@ func parseCommand(b []byte) (*Command, error) { return nil, errInvalidNewObjId(err) } - return &Command{Old: oh, New: nh, Name: plumbing.ReferenceName(n)}, nil + return &Command{Old: oh, New: nh, Name: n}, nil } func parseHash(s string) (plumbing.Hash, error) { diff --git a/plumbing/transport/ssh/auth_method.go b/plumbing/transport/ssh/auth_method.go index dbb47c5..1e5c383 100644 --- a/plumbing/transport/ssh/auth_method.go +++ b/plumbing/transport/ssh/auth_method.go @@ -61,7 +61,7 @@ func (a *KeyboardInteractive) ClientConfig() (*ssh.ClientConfig, error) { return a.SetHostKeyCallback(&ssh.ClientConfig{ User: a.User, Auth: []ssh.AuthMethod{ - ssh.KeyboardInteractiveChallenge(a.Challenge), + a.Challenge, }, }) } |