| 1127 | }; |
| 1128 | |
| 1129 | static int open_fetch_head(struct fetch_head *fetch_head) |
| 1130 | { |
| 1131 | const char *filename = git_path_fetch_head(the_repository); |
| 1132 | |
| 1133 | if (write_fetch_head) { |
| 1134 | fetch_head->fp = fopen(filename, "a"); |
| 1135 | if (!fetch_head->fp) |
| 1136 | return error_errno(_("cannot open '%s'"), filename); |
| 1137 | strbuf_init(&fetch_head->buf, 0); |
| 1138 | } else { |
| 1139 | fetch_head->fp = NULL; |
| 1140 | } |
| 1141 | |
| 1142 | return 0; |
| 1143 | } |
| 1144 | |
| 1145 | static void append_fetch_head(struct fetch_head *fetch_head, |
| 1146 | const struct object_id *old_oid, |
no test coverage detected