|
@@ -101,6 +101,11 @@ def _format_range_unified(start, stop):
|
|
|
|
|
|
def unified_diff(a, b, fromfile='', tofile='', fromfiledate='',
|
|
|
tofiledate='', n=3, lineterm='\n'):
|
|
|
+ """difflib.unified_diff that can detect "No newline at end of file" as
|
|
|
+ original "git diff" does.
|
|
|
+
|
|
|
+ Based on the same function in Python2.7 difflib.py
|
|
|
+ """
|
|
|
started = False
|
|
|
for group in SequenceMatcher(None, a, b).get_grouped_opcodes(n):
|
|
|
if not started:
|