repository: update status() to return string value of file path.
authorwanchao-xu <wanchao.xu@samsung.com>
Fri, 26 Apr 2024 09:50:50 +0000 (17:50 +0800)
committerwanchao-xu <wanchao.xu@samsung.com>
Fri, 26 Apr 2024 09:50:50 +0000 (17:50 +0800)
Change-Id: Idf3cfc2a14ee801bf62fc3b09bf37d8ad51f559f
Signed-off-by: wanchao-xu <wanchao.xu@samsung.com>
gbp/git/repository.py
tests/doctests/test_GitRepository.py

index a851620f011844a0c53b68ba54090763a840117c..a7810dcf94ce0a276dbe41a5ac982c94f88bdec6 100644 (file)
@@ -934,7 +934,7 @@ class GitRepository(object):
             # Expect to have two filenames for renames and copies
             if status[0] in ['R', 'C']:
                 filepath = elements.pop(0) + b'\x00' + filepath
-            result[status].append(filepath)
+            result[status].append(filepath.decode())
 
         return result
 
index 7d96a9b1c701bd3941ecce3a54cf6319f435cfdd..83a2f93a6150031a33a18610e47c032778ceb0b1 100644 (file)
@@ -1000,16 +1000,16 @@ def test_status():
     >>> fname = os.path.join(repo.path, "test_status")
     >>> ret = shutil.copy(os.path.join(repo.path, ".git/HEAD"), fname)
     >>> list(repo.status().items())
-    [('??', [b'test_status'])]
+    [('??', ['test_status'])]
     >>> list(repo.status(['bla*']).items())
     []
     >>> list(repo.status(['te*']).items())
-    [('??', [b'test_status'])]
+    [('??', ['test_status'])]
     >>> repo.add_files(repo.path, force=True)
     >>> repo.commit_all(msg='added %s' % fname)
     >>> _ = repo._git_inout('mv', [fname, fname + 'new'])
     >>> list(repo.status().items())
-    [('R ', [b'test_status\x00test_statusnew'])]
+    [('R ', ['test_status\x00test_statusnew'])]
     """