lib/bpgit.py: add support for git paranoia
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Mon, 21 Oct 2013 09:08:29 +0000 (11:08 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 21 Oct 2013 19:50:38 +0000 (21:50 +0200)
This cleans sanitizes a source tree and ensures
no content is present from what was intended.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
lib/bpgit.py

index 02f6d8a77be9321fba37121ec89f54aded697a43..65403367724d73f36ea612524e00db3016c1b4ed 100644 (file)
@@ -119,6 +119,13 @@ def verify(git_tree):
 
     return dict(r=process.returncode, output=stdout)
 
+def paranoia(tree):
+    clean(tree)
+    poo = status(tree)
+    if (poo):
+        return dict(r=-1, output=poo)
+    return verify(tree)
+
 def init(tree=None):
     process = subprocess.Popen(['git', 'init'],
                                stdout=subprocess.PIPE, stderr=subprocess.STDOUT,