We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a1ceaf9 + 734bc18 commit 327251cCopy full SHA for 327251c
diffcore-rename.c
@@ -84,6 +84,18 @@ static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
84
85
first = 0;
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
99
while (last > first) {
100
int next = first + ((last - first) >> 1);
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)
109
first = next+1;
110
}
111
112
+append_it:
113
/* insert to make it at "first" */
114
ALLOC_GROW(rename_src, rename_src_nr + 1, rename_src_alloc);
102
115
rename_src_nr++;
0 commit comments