File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,18 @@ static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
82
82
83
83
first = 0 ;
84
84
last = rename_src_nr ;
85
+
86
+ if (last > 0 ) {
87
+ struct diff_rename_src * src = & (rename_src [last - 1 ]);
88
+ int cmp = strcmp (one -> path , src -> p -> one -> path );
89
+ if (!cmp )
90
+ return src ;
91
+ if (cmp > 0 ) {
92
+ first = last ;
93
+ goto append_it ;
94
+ }
95
+ }
96
+
85
97
while (last > first ) {
86
98
int next = first + ((last - first ) >> 1 );
87
99
struct diff_rename_src * src = & (rename_src [next ]);
@@ -95,6 +107,7 @@ static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
95
107
first = next + 1 ;
96
108
}
97
109
110
+ append_it :
98
111
/* insert to make it at "first" */
99
112
ALLOC_GROW (rename_src , rename_src_nr + 1 , rename_src_alloc );
100
113
rename_src_nr ++ ;
You can’t perform that action at this time.
0 commit comments