By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Fix hunk header parsing

roundabout,
created on Wednesday, 3 April 2024, 09:01:35 (1712134895), received on Wednesday, 31 July 2024, 06:54:44 (1722408884)
Author identity: vlad <vlad.muntoiu@gmail.com>

23467060d176aaecd74101e6cb16fe0ab1d12a4e

jinja_utils.py

@@ -31,4 +31,5 @@ def decode(value: str):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            @app.template_filter("parse_diff_location")
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def decode(value: str):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return [tuple(int(j) for j in i.lstrip("-+").split(",")) for i in value.removeprefix("@@ ").removesuffix(" @@").split(" ")]
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            header = value.split("@@")[1].strip()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            return [tuple(int(j) for j in i.lstrip("-+").split(",")) for i in header.split(" ")]