Returns the filename prefixed by the state_dir */
| 421 | |
| 422 | /* Returns the filename prefixed by the state_dir */ |
| 423 | static const char *state_dir_path(const char *filename, struct rebase_options *opts) |
| 424 | { |
| 425 | static struct strbuf path = STRBUF_INIT; |
| 426 | static size_t prefix_len; |
| 427 | |
| 428 | if (!prefix_len) { |
| 429 | strbuf_addf(&path, "%s/", opts->state_dir); |
| 430 | prefix_len = path.len; |
| 431 | } |
| 432 | |
| 433 | strbuf_setlen(&path, prefix_len); |
| 434 | strbuf_addstr(&path, filename); |
| 435 | return path.buf; |
| 436 | } |
| 437 | |
| 438 | /* Initialize the rebase options from the state directory. */ |
| 439 | static int read_basic_state(struct rebase_options *opts) |
no test coverage detected