From: wanchao-xu Date: Fri, 26 Apr 2024 09:50:50 +0000 (+0800) Subject: repository: update status() to return string value of file path. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=182ff609a44363f1c863b5a0ae83ca030215fc69;p=tools%2Fgit-buildpackage.git repository: update status() to return string value of file path. Change-Id: Idf3cfc2a14ee801bf62fc3b09bf37d8ad51f559f Signed-off-by: wanchao-xu --- diff --git a/gbp/git/repository.py b/gbp/git/repository.py index a851620f..a7810dcf 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -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 diff --git a/tests/doctests/test_GitRepository.py b/tests/doctests/test_GitRepository.py index 7d96a9b1..83a2f93a 100644 --- a/tests/doctests/test_GitRepository.py +++ b/tests/doctests/test_GitRepository.py @@ -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'])] """