Content
View differences
Updated by Oliver Günther almost 11 years ago
The git adapter `#annotate` functionality uses `git blame` to determine last authorship for a given file. To avoid calling `blame` on binary files leading to garbled output, the git adapter
uses the following check to test for binary files:
@ if content.respond\_to?(:force\_encoding) && (content.dup.force\_encoding(‘UTF-8’) \!= content.dup.force\_encoding(‘BINARY’))@
This check also fails when an author has a UTF-8 encoded name with non-ascii (e.g., an umlaut) characters. In this case, the file cannot be annotated.
uses the following check to test for binary files:
@ if content.respond\_to?(:force\_encoding) && (content.dup.force\_encoding(‘UTF-8’) \!= content.dup.force\_encoding(‘BINARY’))@
This check also fails when an author has a UTF-8 encoded name with non-ascii (e.g., an umlaut) characters. In this case, the file cannot be annotated.