| 658 | } |
| 659 | |
| 660 | static void tree_write_stack_init_subtree(struct tree_write_stack *tws, |
| 661 | const char *path) |
| 662 | { |
| 663 | struct tree_write_stack *n; |
| 664 | assert(!tws->next); |
| 665 | assert(tws->path[0] == '\0' && tws->path[1] == '\0'); |
| 666 | n = (struct tree_write_stack *) |
| 667 | xmalloc(sizeof(struct tree_write_stack)); |
| 668 | n->next = NULL; |
| 669 | strbuf_init(&n->buf, 256 * (32 + the_hash_algo->hexsz)); /* assume 256 entries per tree */ |
| 670 | n->path[0] = n->path[1] = '\0'; |
| 671 | tws->next = n; |
| 672 | tws->path[0] = path[0]; |
| 673 | tws->path[1] = path[1]; |
| 674 | } |
| 675 | |
| 676 | static int tree_write_stack_finish_subtree(struct tree_write_stack *tws) |
| 677 | { |
no test coverage detected