diff mbox series

[59/74] backports: bpgit: handle copied files properly in status()

Message ID 20240524190907.9e6de8b13f7b.I0331054c4f3fad9d33b9e51228dabd6a28bbf8fb@changeid (mailing list archive)
State New
Headers show
Series backport updates from Intel | expand

Commit Message

Johannes Berg May 24, 2024, 5:08 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

'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 <johannes.berg@intel.com>
---
 lib/bpgit.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/bpgit.py b/lib/bpgit.py
index c48640871982..ed3b236933d5 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)