| 104 | } |
| 105 | |
| 106 | static int open_output_fd(char *path, const struct cache_entry *ce, int to_tempfile) |
| 107 | { |
| 108 | int symlink = (ce->ce_mode & S_IFMT) != S_IFREG; |
| 109 | if (to_tempfile) { |
| 110 | xsnprintf(path, TEMPORARY_FILENAME_LENGTH, "%s", |
| 111 | symlink ? ".merge_link_XXXXXX" : ".merge_file_XXXXXX"); |
| 112 | return mkstemp(path); |
| 113 | } else { |
| 114 | return create_file(path, !symlink ? ce->ce_mode : 0666); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st) |
| 119 | { |
no test coverage detected