| 105 | |
| 106 | |
| 107 | static void verify_working_tree_path(struct repository *r, |
| 108 | struct commit *work_tree, const char *path) |
| 109 | { |
| 110 | struct commit_list *parents; |
| 111 | int pos; |
| 112 | |
| 113 | for (parents = work_tree->parents; parents; parents = parents->next) { |
| 114 | const struct object_id *commit_oid = &parents->item->object.oid; |
| 115 | struct object_id blob_oid; |
| 116 | unsigned short mode; |
| 117 | |
| 118 | if (!get_tree_entry(r, commit_oid, path, &blob_oid, &mode) && |
| 119 | odb_read_object_info(r->objects, &blob_oid, NULL) == OBJ_BLOB) |
| 120 | return; |
| 121 | } |
| 122 | |
| 123 | pos = index_name_pos(r->index, path, strlen(path)); |
| 124 | if (pos >= 0) |
| 125 | ; /* path is in the index */ |
| 126 | else if (-1 - pos < r->index->cache_nr && |
| 127 | !strcmp(r->index->cache[-1 - pos]->name, path)) |
| 128 | ; /* path is in the index, unmerged */ |
| 129 | else |
| 130 | die("no such path '%s' in HEAD", path); |
| 131 | } |
| 132 | |
| 133 | static struct commit_list **append_parent(struct repository *r, |
| 134 | struct commit_list **tail, |
no test coverage detected