chiark / gitweb /
Refactor stgit.commands.edit
[stgit] / stgit / lib / git.py
index 22fdce4b99a5b1e8ef38a5cd86e16da361b9f775..0a208ef06c24768f25b3d5d8c488430e10490f85 100644 (file)
@@ -900,3 +900,8 @@ class Branch(object):
         repository.run(['git', 'branch', create_at.sha1]).discard_output()
 
         return cls(repository, name)
+
+def diffstat(diff):
+    """Return the diffstat of the supplied diff."""
+    return run.Run('git', 'apply', '--stat', '--summary'
+                   ).raw_input(diff).raw_output()