MCPcopy Create free account
hub / github.com/git/git / check_global_conv_flags_eol

Function check_global_conv_flags_eol

convert.c:197–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197static void check_global_conv_flags_eol(const char *path,
198 struct text_stat *old_stats, struct text_stat *new_stats,
199 int conv_flags)
200{
201 if (old_stats->crlf && !new_stats->crlf ) {
202 /*
203 * CRLFs would not be restored by checkout
204 */
205 if (conv_flags & CONV_EOL_RNDTRP_DIE)
206 die(_("CRLF would be replaced by LF in %s"), path);
207 else if (conv_flags & CONV_EOL_RNDTRP_WARN)
208 warning(_("in the working copy of '%s', CRLF will be"
209 " replaced by LF the next time Git touches"
210 " it"), path);
211 } else if (old_stats->lonelf && !new_stats->lonelf ) {
212 /*
213 * CRLFs would be added by checkout
214 */
215 if (conv_flags & CONV_EOL_RNDTRP_DIE)
216 die(_("LF would be replaced by CRLF in %s"), path);
217 else if (conv_flags & CONV_EOL_RNDTRP_WARN)
218 warning(_("in the working copy of '%s', LF will be"
219 " replaced by CRLF the next time Git touches"
220 " it"), path);
221 }
222}
223
224static int has_crlf_in_index(struct index_state *istate, const char *path)
225{

Callers 1

crlf_to_gitFunction · 0.85

Calls 2

warningFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected