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 @@ -84,6 +84,18 @@ static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
84
84
85
85
first = 0 ;
86
86
last = rename_src_nr ;
87
+
88
+ if (last > 0 ) {
89
+ struct diff_rename_src * src = & (rename_src [last - 1 ]);
90
+ int cmp = strcmp (one -> path , src -> p -> one -> path );
91
+ if (!cmp )
92
+ return src ;
93
+ if (cmp > 0 ) {
94
+ first = last ;
95
+ goto append_it ;
96
+ }
97
+ }
98
+
87
99
while (last > first ) {
88
100
int next = first + ((last - first ) >> 1 );
89
101
struct diff_rename_src * src = & (rename_src [next ]);
@@ -97,6 +109,7 @@ static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
97
109
first = next + 1 ;
98
110
}
99
111
112
+ append_it :
100
113
/* insert to make it at "first" */
101
114
ALLOC_GROW (rename_src , rename_src_nr + 1 , rename_src_alloc );
102
115
rename_src_nr ++ ;
You can’t perform that action at this time.
0 commit comments