aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-24 17:35:58 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-24 17:35:58 -0800
commit026680f881e751311674d97d0f6ed87f06a92bfb (patch)
tree770bcfc2a3746cd568fbe17fea2926f6da2c7fa8 /diff.c
parenteca9388f398eb3256fafbf875a8a4ff5a73ab6f2 (diff)
parentba655da537a999670c7b21e0446e774a1f9733ea (diff)
downloadgit-026680f881e751311674d97d0f6ed87f06a92bfb.tar.gz
git-026680f881e751311674d97d0f6ed87f06a92bfb.tar.xz
Merge branch 'jc/fix-tree-walk'
* jc/fix-tree-walk: read-tree --debug-unpack unpack-trees.c: look ahead in the index unpack-trees.c: prepare for looking ahead in the index Aggressive three-way merge: fix D/F case traverse_trees(): handle D/F conflict case sanely more D/F conflict tests tests: move convenience regexp to match object names to test-lib.sh Conflicts: builtin-read-tree.c unpack-trees.c unpack-trees.h
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 160dbfd71..f130a367d 100644
--- a/diff.c
+++ b/diff.c
@@ -3678,6 +3678,23 @@ static void diffcore_skip_stat_unmatch(struct diff_options *diffopt)
*q = outq;
}
+static int diffnamecmp(const void *a_, const void *b_)
+{
+ const struct diff_filepair *a = *((const struct diff_filepair **)a_);
+ const struct diff_filepair *b = *((const struct diff_filepair **)b_);
+ const char *name_a, *name_b;
+
+ name_a = a->one ? a->one->path : a->two->path;
+ name_b = b->one ? b->one->path : b->two->path;
+ return strcmp(name_a, name_b);
+}
+
+void diffcore_fix_diff_index(struct diff_options *options)
+{
+ struct diff_queue_struct *q = &diff_queued_diff;
+ qsort(q->queue, q->nr, sizeof(q->queue[0]), diffnamecmp);
+}
+
void diffcore_std(struct diff_options *options)
{
if (options->skip_stat_unmatch)