Skip to content

Commit

Permalink
attr: "binary" attribute should choose built-in "binary" merge driver
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gitster committed Sep 9, 2012
1 parent a944af1 commit 155a4b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Documentation/gitattributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------


Expand Down
2 changes: 1 addition & 1 deletion attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
2 changes: 1 addition & 1 deletion t/t6037-merge-ours-theirs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 155a4b7

Please sign in to comment.