cm_crowdin_sync: Support 'git rm'
Change-Id: I24e989868b39be817eb12074350697940ec3d55b
diff --git a/cm_crowdin_aosp_sync.py b/cm_crowdin_aosp_sync.py
index e779e64..4456515 100755
--- a/cm_crowdin_aosp_sync.py
+++ b/cm_crowdin_aosp_sync.py
@@ -150,6 +150,11 @@
# Create git commit
repo = git.Repo(path)
repo.git.add(path)
+ removed_files = repo.git.ls_files(d=True).split('\n')
+ try:
+ repo.git.rm(removed_files)
+ except:
+ pass
try:
repo.git.commit(m='Automatic translation import')
repo.git.push('ssh://' + username + '@review.cyanogenmod.org:29418/' + name, 'HEAD:refs/for/' + branch)
diff --git a/cm_crowdin_sync.py b/cm_crowdin_sync.py
index 32282c8..c985ef7 100755
--- a/cm_crowdin_sync.py
+++ b/cm_crowdin_sync.py
@@ -186,6 +186,11 @@
# Create git commit
repo = git.Repo(path)
repo.git.add(path)
+ removed_files = repo.git.ls_files(d=True).split('\n')
+ try:
+ repo.git.rm(removed_files)
+ except:
+ pass
try:
repo.git.commit(m='Automatic translation import')
repo.git.push('ssh://' + username + '@review.cyanogenmod.org:29418/' + name, 'HEAD:refs/for/' + branch)