t = parts[0]
if t == 'A' or t == 'D' or t == 'M':
modified_files.append((parts[1], t))
- elif t == 'R':
+ elif t.startswith('R'):
modified_files.append((parts[1], 'D'))
modified_files.append((parts[2], 'A'))
return modified_files
import tempfile
import unittest
+from git_commit import GitCommit
+
from git_email import GitEmail
import unidiff
unidiff_supports_renaming = hasattr(unidiff.PatchedFile(), 'is_rename')
+NAME_STATUS1 = """
+M gcc/ada/impunit.adb'
+R097 gcc/ada/libgnat/s-atopar.adb gcc/ada/libgnat/s-aoinar.adb
+"""
+
+
class TestGccChangelog(unittest.TestCase):
def setUp(self):
self.patches = {}
email = self.from_patch_glob('0001-configure.patch')
assert not email.errors
assert len(email.changelog_entries) == 2
+
+ def test_parse_git_name_status(self):
+ modified_files = GitCommit.parse_git_name_status(NAME_STATUS1)
+ assert len(modified_files) == 3
+ assert modified_files[1] == ('gcc/ada/libgnat/s-atopar.adb', 'D')
+ assert modified_files[2] == ('gcc/ada/libgnat/s-aoinar.adb', 'A')