projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge-recursive: conflicting rename case.
[git.git]
/
rev-list.c
diff --git
a/rev-list.c
b/rev-list.c
index
6e6ffde
..
d060966
100644
(file)
--- a/
rev-list.c
+++ b/
rev-list.c
@@
-124,8
+124,6
@@
static int filter_commit(struct commit * commit)
stop_traversal=1;
return CONTINUE;
}
stop_traversal=1;
return CONTINUE;
}
- if (max_count != -1 && !max_count--)
- return STOP;
if (no_merges && (commit->parents && commit->parents->next))
return CONTINUE;
if (paths && dense) {
if (no_merges && (commit->parents && commit->parents->next))
return CONTINUE;
if (paths && dense) {
@@
-148,6
+146,9
@@
static int process_commit(struct commit * commit)
return CONTINUE;
}
return CONTINUE;
}
+ if (max_count != -1 && !max_count--)
+ return STOP;
+
show_commit(commit);
return CONTINUE;
show_commit(commit);
return CONTINUE;
@@
-349,7
+350,8
@@
static int count_distance(struct commit_list *entry)
if (commit->object.flags & (UNINTERESTING | COUNTED))
break;
if (commit->object.flags & (UNINTERESTING | COUNTED))
break;
- nr++;
+ if (!paths || (commit->object.flags & TREECHANGE))
+ nr++;
commit->object.flags |= COUNTED;
p = commit->parents;
entry = p;
commit->object.flags |= COUNTED;
p = commit->parents;
entry = p;
@@
-361,6
+363,7
@@
static int count_distance(struct commit_list *entry)
}
}
}
}
}
}
+
return nr;
}
return nr;
}
@@
-381,15
+384,20
@@
static struct commit_list *find_bisection(struct commit_list *list)
nr = 0;
p = list;
while (p) {
nr = 0;
p = list;
while (p) {
- nr++;
+ if (!paths || (p->item->object.flags & TREECHANGE))
+ nr++;
p = p->next;
}
closest = 0;
best = list;
p = p->next;
}
closest = 0;
best = list;
- p = list;
- while (p) {
- int distance = count_distance(p);
+ for (p = list; p; p = p->next) {
+ int distance;
+
+ if (paths && !(p->item->object.flags & TREECHANGE))
+ continue;
+
+ distance = count_distance(p);
clear_distance(list);
if (nr - distance < distance)
distance = nr - distance;
clear_distance(list);
if (nr - distance < distance)
distance = nr - distance;
@@
-397,7
+405,6
@@
static struct commit_list *find_bisection(struct commit_list *list)
best = p;
closest = distance;
}
best = p;
closest = distance;
}
- p = p->next;
}
if (best)
best->next = NULL;
}
if (best)
best->next = NULL;
@@
-843,7
+850,8
@@
int main(int argc, const char **argv)
handle_one_commit(commit, &list);
}
handle_one_commit(commit, &list);
}
- if (!list)
+ if (!list &&
+ (!(tag_objects||tree_objects||blob_objects) && !pending_objects))
usage(rev_list_usage);
paths = get_pathspec(prefix, argv + i);
usage(rev_list_usage);
paths = get_pathspec(prefix, argv + i);