diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-25 02:35:58 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-25 02:35:58 +0100 |
commit | 026680f881e751311674d97d0f6ed87f06a92bfb (patch) | |
tree | 770bcfc2a3746cd568fbe17fea2926f6da2c7fa8 /diff.c | |
parent | Make test numbers unique (diff) | |
parent | read-tree --debug-unpack (diff) | |
download | git-026680f881e751311674d97d0f6ed87f06a92bfb.tar.xz git-026680f881e751311674d97d0f6ed87f06a92bfb.zip |
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.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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) |