Skip to content

Commit 155a4b7

Browse files
committed
attr: "binary" attribute should choose built-in "binary" merge driver
The built-in "binary" attribute macro expands to "-diff -text", so that textual diff is not produced, and the contents will not go through any CR/LF conversion ever. During a merge, it should also choose the "binary" low-level merge driver, but it didn't. Make it expand to "-diff -merge -text". Signed-off-by: Junio C Hamano <[email protected]>
1 parent a944af1 commit 155a4b7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Documentation/gitattributes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ file at the toplevel (i.e. not in any subdirectory). The built-in
904904
macro attribute "binary" is equivalent to:
905905

906906
------------
907-
[attr]binary -diff -text
907+
[attr]binary -diff -merge -text
908908
------------
909909

910910

attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static void free_attr_elem(struct attr_stack *e)
306306
}
307307

308308
static const char *builtin_attr[] = {
309-
"[attr]binary -diff -text",
309+
"[attr]binary -diff -merge -text",
310310
NULL,
311311
};
312312

t/t6037-merge-ours-theirs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test_expect_success 'recursive favouring ours' '
5454
'
5555

5656
test_expect_success 'binary file with -Xours/-Xtheirs' '
57-
echo "file -merge" >.gitattributes &&
57+
echo file binary >.gitattributes &&
5858
5959
git reset --hard master &&
6060
git merge -s recursive -X theirs side &&

0 commit comments

Comments
 (0)