瀏覽代碼

added docstring for unified_diff implementation

Taras Postument 7 年之前
父節點
當前提交
553a611fd0
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      dulwich/patch.py

+ 5 - 0
dulwich/patch.py

@@ -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: