diff mbox series

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

Message ID 20240627234808.1253337-11-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 6.1.95 | expand

Commit Message

Hauke Mehrtens June 27, 2024, 11:46 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>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/135974
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Tested-by: Luciano Coelho <luciano.coelho@intel.com>
---
 lib/bpgit.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Johannes Berg June 28, 2024, 10:34 a.m. UTC | #1
On Fri, 2024-06-28 at 01:46 +0200, Hauke Mehrtens wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> 'C' as the setatus also has two files, so need to continue

correcting myself, I guess - 'status'
> 
> Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/135974

Also here.

johannes
Hauke Mehrtens June 30, 2024, 9:28 p.m. UTC | #2
On 6/28/24 12:34, Johannes Berg wrote:
> On Fri, 2024-06-28 at 01:46 +0200, Hauke Mehrtens wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>>
>> 'C' as the setatus also has two files, so need to continue
> 
> correcting myself, I guess - 'status'
>>
>> Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/135974
> 
> Also here.
> 
> johannes

Fixed it and removed all the Intel specific tags form all commits.

Hauke
diff mbox series

Patch

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)