backports: use --ignore-removal for git add
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Wed, 2 Apr 2014 10:44:42 +0000 (10:44 +0000)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Wed, 9 Apr 2014 01:16:21 +0000 (18:16 -0700)
As of git 2.0 --ignore-removal is no longer default so just
make it default tool, without which git will warn us about
this change.

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

index 15089d748de6eb715c1345abe284697221eb489b..f56e377a96429bee490a8150ca88762f48263816 100644 (file)
@@ -142,7 +142,7 @@ def init(tree=None):
     _check(process)
 
 def add(path, tree=None):
-    process = subprocess.Popen(['git', 'add', path],
+    process = subprocess.Popen(['git', 'add', '--ignore-removal', path],
                                stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                                close_fds=True, universal_newlines=True, cwd=tree)
     stdout = process.communicate()[0]
@@ -266,7 +266,7 @@ def ls_remote(branch, tree=None, remote='origin'):
     return sha
 
 def add(fn, tree=None):
-    process = subprocess.Popen(['git', 'add', fn], cwd=tree,
+    process = subprocess.Popen(['git', 'add', '--ignore-removal', fn], cwd=tree,
                                close_fds=True, universal_newlines=True)
     process.wait()
     _check(process)