*: avoid unnecessary conversions

No need to convert these values, they're already of the right type.

Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com>
(cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346)
diff --git a/blame.go b/blame.go
index adb72d5..f610851 100644
--- a/blame.go
+++ b/blame.go
@@ -193,7 +193,7 @@
 		// this first commit.
 		if i == 0 {
 			for j := 0; j < nLines; j++ {
-				b.graph[i][j] = (*object.Commit)(b.revs[i])
+				b.graph[i][j] = b.revs[i]
 			}
 		} else {
 			// if this is not the first commit, then assign to the old
@@ -211,7 +211,7 @@
 	fVs := b.graph[i]
 	result := make([]*object.Commit, 0, len(fVs))
 	for _, v := range fVs {
-		c := object.Commit(*v)
+		c := *v
 		result = append(result, &c)
 	}
 	return result
@@ -234,7 +234,7 @@
 				b.graph[c][dl] = b.graph[p][sl]
 			case hunks[h].Type == 1:
 				dl++
-				b.graph[c][dl] = (*object.Commit)(b.revs[c])
+				b.graph[c][dl] = b.revs[c]
 			case hunks[h].Type == -1:
 				sl++
 			default:
diff --git a/config/branch.go b/config/branch.go
index af61bbb..20dde6e 100644
--- a/config/branch.go
+++ b/config/branch.go
@@ -72,7 +72,7 @@
 	if b.Rebase == "" {
 		b.raw.RemoveOption(rebaseKey)
 	} else {
-		b.raw.SetOption(rebaseKey, string(b.Rebase))
+		b.raw.SetOption(rebaseKey, b.Rebase)
 	}
 
 	return b.raw
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 @@
 // 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 @@
 // 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 @@
 		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 @@
 	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 @@
 			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 @@
 		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 @@
 		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 @@
 		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 @@
 	return a.SetHostKeyCallback(&ssh.ClientConfig{
 		User: a.User,
 		Auth: []ssh.AuthMethod{
-			ssh.KeyboardInteractiveChallenge(a.Challenge),
+			a.Challenge,
 		},
 	})
 }
diff --git a/utils/merkletrie/difftree_test.go b/utils/merkletrie/difftree_test.go
index ac86145..f725bcf 100644
--- a/utils/merkletrie/difftree_test.go
+++ b/utils/merkletrie/difftree_test.go
@@ -177,7 +177,7 @@
 
 	for _, chunk := range strings.Split(s, " ") {
 		change := change{
-			path: string(chunk[1:]),
+			path: chunk[1:],
 		}
 
 		switch chunk[0] {
diff --git a/utils/merkletrie/noder/path_test.go b/utils/merkletrie/noder/path_test.go
index f49f028..f65b1d5 100644
--- a/utils/merkletrie/noder/path_test.go
+++ b/utils/merkletrie/noder/path_test.go
@@ -154,8 +154,8 @@
 }
 
 func (s *PathSuite) TestCompareNormalization(c *C) {
-	p1 := Path([]Noder{&noderMock{name: norm.Form(norm.NFKC).String("페")}})
-	p2 := Path([]Noder{&noderMock{name: norm.Form(norm.NFKD).String("페")}})
+	p1 := Path([]Noder{&noderMock{name: norm.NFKC.String("페")}})
+	p2 := Path([]Noder{&noderMock{name: norm.NFKD.String("페")}})
 	c.Assert(p1.Compare(p2), Equals, 1)
 	c.Assert(p2.Compare(p1), Equals, -1)
 	p1 = Path([]Noder{&noderMock{name: "TestAppWithUnicodéPath"}})
diff --git a/worktree_linux.go b/worktree_linux.go
index 891cb1c..efb01b5 100644
--- a/worktree_linux.go
+++ b/worktree_linux.go
@@ -12,7 +12,7 @@
 func init() {
 	fillSystemInfo = func(e *index.Entry, sys interface{}) {
 		if os, ok := sys.(*syscall.Stat_t); ok {
-			e.CreatedAt = time.Unix(int64(os.Ctim.Sec), int64(os.Ctim.Nsec))
+			e.CreatedAt = time.Unix(os.Ctim.Sec, os.Ctim.Nsec)
 			e.Dev = uint32(os.Dev)
 			e.Inode = uint32(os.Ino)
 			e.GID = os.Gid
diff --git a/worktree_test.go b/worktree_test.go
index 1f87957..dab1c23 100644
--- a/worktree_test.go
+++ b/worktree_test.go
@@ -432,7 +432,7 @@
 	err = w.Filesystem.Remove(filename)
 	c.Assert(err, IsNil)
 
-	modFilename := norm.Form(norm.NFKD).String(filename)
+	modFilename := norm.NFKD.String(filename)
 	writeFile(modFilename)
 
 	_, err = w.Add(filename)