mirror of
https://github.com/git/git.git
synced 2024-05-19 21:06:09 +02:00
Merge branch 'ah/convert-warning-message' into next
Update a few end-user facing messages around eol conversion. * ah/convert-warning-message: convert: clarify line ending conversion warning
This commit is contained in:
commit
a9f8f32904
12
convert.c
12
convert.c
|
@ -195,9 +195,9 @@ static void check_global_conv_flags_eol(const char *path,
|
||||||
if (conv_flags & CONV_EOL_RNDTRP_DIE)
|
if (conv_flags & CONV_EOL_RNDTRP_DIE)
|
||||||
die(_("CRLF would be replaced by LF in %s"), path);
|
die(_("CRLF would be replaced by LF in %s"), path);
|
||||||
else if (conv_flags & CONV_EOL_RNDTRP_WARN)
|
else if (conv_flags & CONV_EOL_RNDTRP_WARN)
|
||||||
warning(_("CRLF will be replaced by LF in %s.\n"
|
warning(_("in the working copy of '%s', CRLF will be"
|
||||||
"The file will have its original line"
|
" replaced by LF the next time Git touches"
|
||||||
" endings in your working directory"), path);
|
" it"), path);
|
||||||
} else if (old_stats->lonelf && !new_stats->lonelf ) {
|
} else if (old_stats->lonelf && !new_stats->lonelf ) {
|
||||||
/*
|
/*
|
||||||
* CRLFs would be added by checkout
|
* CRLFs would be added by checkout
|
||||||
|
@ -205,9 +205,9 @@ static void check_global_conv_flags_eol(const char *path,
|
||||||
if (conv_flags & CONV_EOL_RNDTRP_DIE)
|
if (conv_flags & CONV_EOL_RNDTRP_DIE)
|
||||||
die(_("LF would be replaced by CRLF in %s"), path);
|
die(_("LF would be replaced by CRLF in %s"), path);
|
||||||
else if (conv_flags & CONV_EOL_RNDTRP_WARN)
|
else if (conv_flags & CONV_EOL_RNDTRP_WARN)
|
||||||
warning(_("LF will be replaced by CRLF in %s.\n"
|
warning(_("in the working copy of '%s', LF will be"
|
||||||
"The file will have its original line"
|
" replaced by CRLF the next time Git touches"
|
||||||
" endings in your working directory"), path);
|
" it"), path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,12 +77,12 @@ create_NNO_MIX_files () {
|
||||||
|
|
||||||
check_warning () {
|
check_warning () {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
LF_CRLF) echo "warning: LF will be replaced by CRLF" >"$2".expect ;;
|
LF_CRLF) echo "LF will be replaced by CRLF" >"$2".expect ;;
|
||||||
CRLF_LF) echo "warning: CRLF will be replaced by LF" >"$2".expect ;;
|
CRLF_LF) echo "CRLF will be replaced by LF" >"$2".expect ;;
|
||||||
'') >"$2".expect ;;
|
'') >"$2".expect ;;
|
||||||
*) echo >&2 "Illegal 1": "$1" ; return false ;;
|
*) echo >&2 "Illegal 1": "$1" ; return false ;;
|
||||||
esac
|
esac
|
||||||
grep "will be replaced by" "$2" | sed -e "s/\(.*\) in [^ ]*$/\1/" | uniq >"$2".actual
|
sed -e "s/^.* \([^ ]* will be replaced by [^ ]*\) .*$/\1/" "$2" | uniq >"$2".actual
|
||||||
test_cmp "$2".expect "$2".actual
|
test_cmp "$2".expect "$2".actual
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue