@@ -31,9 +31,33 @@ func TestGetTreeBySHA(t *testing.T) {
31
31
tree , err := GetTreeBySHA (ctx , ctx .Repo .Repository , ctx .Repo .GitRepo , ctx .Params (":sha" ), page , perPage , true )
32
32
assert .NoError (t , err )
33
33
expectedTree := & api.GitTreeResponse {
34
- SHA : "65f1bf27bc3bf70f64657658635e66094edbcb4d " ,
35
- URL : "https://try.gitea.io/api/v1/repos/user2/repo1/git/trees/65f1bf27bc3bf70f64657658635e66094edbcb4d " ,
34
+ SHA : "94dc45d6ec51090b36c4d5bd5d9e6f5a70da9edf " ,
35
+ URL : "https://try.gitea.io/api/v1/repos/user2/repo1/git/trees/94dc45d6ec51090b36c4d5bd5d9e6f5a70da9edf " ,
36
36
Entries : []api.GitEntry {
37
+ {
38
+ Path : ".gitea" ,
39
+ Mode : "040000" ,
40
+ Type : "tree" ,
41
+ Size : 0 ,
42
+ SHA : "b5f7dda5e39c1eef0d4da9c20b7d8322daa7add5" ,
43
+ URL : "https://try.gitea.io/api/v1/repos/user2/repo1/git/trees/b5f7dda5e39c1eef0d4da9c20b7d8322daa7add5" ,
44
+ },
45
+ {
46
+ Path : ".gitea/workflows" ,
47
+ Mode : "040000" ,
48
+ Type : "tree" ,
49
+ Size : 0 ,
50
+ SHA : "6cdf13ba35c02977c24effbc90e9ad5032526c03" ,
51
+ URL : "https://try.gitea.io/api/v1/repos/user2/repo1/git/trees/6cdf13ba35c02977c24effbc90e9ad5032526c03" ,
52
+ },
53
+ {
54
+ Path : ".gitea/workflows/test.yaml" ,
55
+ Mode : "100644" ,
56
+ Type : "blob" ,
57
+ Size : 109 ,
58
+ SHA : "ccf9ea61a38482bc656f82ef5f499224712796cf" ,
59
+ URL : "https://try.gitea.io/api/v1/repos/user2/repo1/git/blobs/ccf9ea61a38482bc656f82ef5f499224712796cf" ,
60
+ },
37
61
{
38
62
Path : "README.md" ,
39
63
Mode : "100644" ,
@@ -45,7 +69,7 @@ func TestGetTreeBySHA(t *testing.T) {
45
69
},
46
70
Truncated : false ,
47
71
Page : 1 ,
48
- TotalCount : 1 ,
72
+ TotalCount : 4 ,
49
73
}
50
74
51
75
assert .EqualValues (t , expectedTree , tree )
0 commit comments