зеркало из https://github.com/microsoft/git.git
Merge branch 'maint'
* maint: Fix "apply --reverse" with regard to whitespace
This commit is contained in:
Коммит
0707a9d6f2
|
@ -1003,12 +1003,16 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s
|
|||
trailing++;
|
||||
break;
|
||||
case '-':
|
||||
if (apply_in_reverse &&
|
||||
new_whitespace != nowarn_whitespace)
|
||||
check_whitespace(line, len);
|
||||
deleted++;
|
||||
oldlines--;
|
||||
trailing = 0;
|
||||
break;
|
||||
case '+':
|
||||
if (new_whitespace != nowarn_whitespace)
|
||||
if (!apply_in_reverse &&
|
||||
new_whitespace != nowarn_whitespace)
|
||||
check_whitespace(line, len);
|
||||
added++;
|
||||
newlines--;
|
||||
|
|
|
@ -82,4 +82,10 @@ test_expect_success 'apply in reverse without postimage' '
|
|||
)
|
||||
'
|
||||
|
||||
test_expect_success 'reversing a whitespace introduction' '
|
||||
sed "s/a/a /" < file1 > file1.new &&
|
||||
mv file1.new file1 &&
|
||||
git diff | git apply --reverse --whitespace=error
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
Загрузка…
Ссылка в новой задаче