From 973938cbb5539c7ee7eec3b9895a66f502b16604 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Wed, 8 Aug 2018 11:45:48 +0200 Subject: Bump vendored libgit2 to 9275d84c583 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vendor') diff --git a/vendor/libgit2 b/vendor/libgit2 index 7f6c1ce..9275d84 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 7f6c1ce9760c6c397e94d4eba506faeb95452702 +Subproject commit 9275d84c583a030e759edbfafacf99c42a83c543 -- cgit v1.2.3 From 92501bd663509b4fd3c4796ff99d056eb8818fae Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Sun, 7 Oct 2018 18:50:25 +0200 Subject: Update vendored libgit2 to 838a2f291 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vendor') diff --git a/vendor/libgit2 b/vendor/libgit2 index 9275d84..838a2f2 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 9275d84c583a030e759edbfafacf99c42a83c543 +Subproject commit 838a2f2918b6d9fad8768d2498575ff5d75c35f0 -- cgit v1.2.3 From f969cc900dde4ba92c814823bc004bd1870079a9 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Fri, 4 Jan 2019 13:18:54 +0000 Subject: Bump vendored libgit2 to fba70a9d5f This includes updating the `Index.WriteTreeTo` test as it was abusing an oversight of the object creation safety checks and creating a tree referencing a non-existent blob. Instead we update it to the primary purpose of this method which is to write into a repository from an unattached index. --- index_test.go | 26 +++++++++++++++++++++----- vendor/libgit2 | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'vendor') diff --git a/index_test.go b/index_test.go index f47dace..43644fa 100644 --- a/index_test.go +++ b/index_test.go @@ -3,6 +3,7 @@ package git import ( "io/ioutil" "os" + "path" "runtime" "testing" ) @@ -59,14 +60,29 @@ func TestIndexWriteTreeTo(t *testing.T) { repo := createTestRepo(t) defer cleanupTestRepo(t, repo) - repo2 := createTestRepo(t) - defer cleanupTestRepo(t, repo2) + idx, err := NewIndex() + checkFatal(t, err) - idx, err := repo.Index() + odb, err := repo.Odb() checkFatal(t, err) - err = idx.AddByPath("README") + + content, err := ioutil.ReadFile(path.Join(repo.Workdir(), "README")) + checkFatal(t, err) + + id, err := odb.Write(content, ObjectBlob) checkFatal(t, err) - treeId, err := idx.WriteTreeTo(repo2) + + 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) if treeId.String() != "b7119b11e8ef7a1a5a34d3ac87f5b075228ac81e" { diff --git a/vendor/libgit2 b/vendor/libgit2 index 838a2f2..fba70a9 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 838a2f2918b6d9fad8768d2498575ff5d75c35f0 +Subproject commit fba70a9d5f1fa433968a3dfd51e3153c8eebe834 -- cgit v1.2.3