Merge pull request #471 from libgit2/cmn/bump-libgit2

Bump vendored libgit2 to fba70a9d5f
This commit is contained in:
Carlos Martín Nieto 2019-01-04 13:35:12 +00:00 committed by GitHub
commit b06a2a6900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 6 deletions

View File

@ -3,6 +3,7 @@ package git
import ( import (
"io/ioutil" "io/ioutil"
"os" "os"
"path"
"runtime" "runtime"
"testing" "testing"
) )
@ -59,14 +60,29 @@ func TestIndexWriteTreeTo(t *testing.T) {
repo := createTestRepo(t) repo := createTestRepo(t)
defer cleanupTestRepo(t, repo) defer cleanupTestRepo(t, repo)
repo2 := createTestRepo(t) idx, err := NewIndex()
defer cleanupTestRepo(t, repo2) checkFatal(t, err)
idx, err := repo.Index() odb, err := repo.Odb()
checkFatal(t, err) checkFatal(t, err)
err = idx.AddByPath("README")
content, err := ioutil.ReadFile(path.Join(repo.Workdir(), "README"))
checkFatal(t, err) checkFatal(t, err)
treeId, err := idx.WriteTreeTo(repo2)
id, err := odb.Write(content, ObjectBlob)
checkFatal(t, err)
err = idx.Add(&IndexEntry{
Mode: FilemodeBlob,
Uid: 0,
Gid: 0,
Size: uint32(len(content)),
Id: id,
Path: "README",
})
checkFatal(t, err)
treeId, err := idx.WriteTreeTo(repo)
checkFatal(t, err) checkFatal(t, err)
if treeId.String() != "b7119b11e8ef7a1a5a34d3ac87f5b075228ac81e" { if treeId.String() != "b7119b11e8ef7a1a5a34d3ac87f5b075228ac81e" {

2
vendor/libgit2 vendored

@ -1 +1 @@
Subproject commit 838a2f2918b6d9fad8768d2498575ff5d75c35f0 Subproject commit fba70a9d5f1fa433968a3dfd51e3153c8eebe834