| 198 | } |
| 199 | |
| 200 | static bool gf_tree(gf_fixture_t *fx, int version, char out[65]) { |
| 201 | const char *empty[] = {"read-tree", "--empty", NULL}; |
| 202 | const char *write[] = {"write-tree", NULL}; |
| 203 | if (!gf_git(fx, empty, NULL, 0)) |
| 204 | return false; |
| 205 | const char *regular[] = {"binary.bin", ":colon.bin", "-dash.bin", "[glob]*.bin", |
| 206 | "dir/file.bin"}; |
| 207 | for (size_t i = 0; i < sizeof(regular) / sizeof(regular[0]); i++) { |
| 208 | if (!gf_index(fx, "100644", fx->binary, regular[i])) |
| 209 | return false; |
| 210 | } |
| 211 | const char *text = version == 1 ? fx->head_text : version == 2 ? fx->base_text : fx->old_text; |
| 212 | if (!gf_index(fx, "100644", text, "p.txt") || |
| 213 | !gf_index(fx, "100644", fx->attrs, ".gitattributes") || |
| 214 | !gf_index(fx, "120000", fx->link, "link")) |
| 215 | return false; |
| 216 | if (version == 1) { |
| 217 | if (!gf_index(fx, "100644", fx->newer, "new.bin") || |
| 218 | !gf_index(fx, "160000", fx->a, "submodule")) |
| 219 | return false; |
| 220 | } else if (!gf_index(fx, "100644", fx->binary, "deleted.bin")) |
| 221 | return false; |
| 222 | return gf_oid(fx, write, out); |
| 223 | } |
| 224 | |
| 225 | static bool gf_commit(gf_fixture_t *fx, const char *tree, const char *parent_one, |
| 226 | const char *parent_two, const char *label, char out[65]) { |
no test coverage detected