[PATCH 10/75] backports: bpgit: handle copied files properly in status()

Hauke Mehrtens <[email protected]> Fri, 28 Jun 2024 01:46:56 +0200
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
From: Johannes Berg <[email protected]>

'C' as the setatus also has two files, so need to continue
as well to get the second file added to this line.

Signed-off-by: Johannes Berg <[email protected]>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/135974
Reviewed-by: Luciano Coelho <[email protected]>
Tested-by: Luciano Coelho <[email protected]>
---
 lib/bpgit.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bpgit.py b/lib/bpgit.py
index c4864087..ed3b2369 100644
--- a/lib/bpgit.py
+++ b/lib/bpgit.py
@@ -50,7 +50,7 @@ def status(tree=None):
     of the form
     ('XY', 'filename')
     or
-    ('XY', 'filename_to', 'filename_from')   [if X is 'R' for rename]
+    ('XY', 'filename_to', 'filename_from')   [if X is 'R' for rename or 'C' for copy]
     '''
     cmd = ['git', 'status', '--porcelain', '-z']
 
@@ -70,7 +70,7 @@ def status(tree=None):
             cur.append(i[:2])
             assert i[2] == ' '
             cur.append(i[3:])
-            if i[0] == 'R':
+            if i[0] in ['R', 'C']:
                 continue
         else:
             cur.append(i)
-- 
2.45.2