From 3cbfdf37f48c7b2f8726ad7e60a963cae1d8fd21 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Mon, 9 Sep 2013 14:21:16 +0200 Subject: Add Filemode to TreeEntry This field was missing, so let's add it, and let's add the const definitions for the modes while we're here. --- object_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'object_test.go') diff --git a/object_test.go b/object_test.go index 82dce98..41efecf 100644 --- a/object_test.go +++ b/object_test.go @@ -33,10 +33,15 @@ func TestObjectPoymorphism(t *testing.T) { t.Fatalf("Converting back to *Tree is not ok") } - if tree2.EntryByName("README") == nil { + entry := tree2.EntryByName("README") + if entry == nil { t.Fatalf("Tree did not have expected \"README\" entry") } + if entry.Filemode != FilemodeBlob { + t.Fatal("Wrong filemode for \"README\"") + } + _, ok = obj.(*Commit) if ok { t.Fatalf("*Tree is somehow the same as *Commit") -- cgit v1.2.3