diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-21 11:08:27 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-28 22:20:17 +0100 |
commit | b5aa4260da3180e4f4bd6d6d86d02e93722b477b (patch) | |
tree | 2abb26d944659c1345ff97b3b9acd26bffecabac | |
parent | 1b200019bc7ed87b56bfee5b2e3a2e65f0b129f8 (diff) |
lib/bpgit.py: add git clean support
Upstream commit: 52aca1afb093baef20140b33d50426ecf80d3f6d
We'll use this later.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rw-r--r-- | lib/bpgit.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/bpgit.py b/lib/bpgit.py index d2fb9862..f4af314a 100644 --- a/lib/bpgit.py +++ b/lib/bpgit.py @@ -27,6 +27,16 @@ def rev_parse(rev='HEAD', tree=None): raise SHAError() return sha +def clean(tree=None): + cmd = ['git', 'clean', '-f', '-x', '-d', '-q'] + + process = subprocess.Popen(cmd, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + close_fds=True, universal_newlines=True, cwd=tree) + stdout = process.communicate()[0] + process.wait() + _check(process) + def status(tree=None): ''' For interpretation of the porcelain output refer to |