attr: "binary" attribute should choose built-in "binary" merge driver
authorJunio C Hamano <gitster@pobox.com>
Sun, 9 Sep 2012 04:28:55 +0000 (21:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 9 Sep 2012 04:28:55 +0000 (21:28 -0700)
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 <gitster@pobox.com>
Documentation/gitattributes.txt
attr.c
t/t6037-merge-ours-theirs.sh
index a85b187e0479b99e137160c1190f174d80675fa1..ead72549227e504523dd4230f04a3865dc0e0c60 100644 (file)
@@ -904,7 +904,7 @@ file at the toplevel (i.e. not in any subdirectory).  The built-in
 macro attribute "binary" is equivalent to:
 
 ------------
-[attr]binary -diff -text
+[attr]binary -diff -merge -text
 ------------
 
 
diff --git a/attr.c b/attr.c
index 303751f6c2bd4d558cffbb928c636581efb2b310..3f581b3cec688aab9e93f6c83f579eef6f378488 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -306,7 +306,7 @@ static void free_attr_elem(struct attr_stack *e)
 }
 
 static const char *builtin_attr[] = {
-       "[attr]binary -diff -text",
+       "[attr]binary -diff -merge -text",
        NULL,
 };
 
index 8d05671414463cf18fa455867254024948e479b7..3889eca4ae8524cd62eaf45b4d7a2394e53da429 100755 (executable)
@@ -54,7 +54,7 @@ test_expect_success 'recursive favouring ours' '
 '
 
 test_expect_success 'binary file with -Xours/-Xtheirs' '
-       echo "file -merge" >.gitattributes &&
+       echo file binary >.gitattributes &&
 
        git reset --hard master &&
        git merge -s recursive -X theirs side &&