diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-09-08 08:54:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-08 08:54:01 -0700 |
commit | 9f44723d1a2c6a97306a7160deeab621e08bea7a (patch) | |
tree | 0ad4ae4a8de137be14011c8b7f3b8c01875ce997 /builtin | |
parent | Merge branch 'maint' (diff) | |
parent | fast-export: ensure that a renamed file is printed after all references (diff) | |
download | tgif-9f44723d1a2c6a97306a7160deeab621e08bea7a.tar.xz |
Merge branch 'en/d-f-conflict-fix'
* en/d-f-conflict-fix:
fast-export: ensure that a renamed file is printed after all references
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fast-export.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c index a9bbf8653d..c8fd46b872 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -167,7 +167,15 @@ static int depth_first(const void *a_, const void *b_) cmp = memcmp(name_a, name_b, len); if (cmp) return cmp; - return (len_b - len_a); + cmp = len_b - len_a; + if (cmp) + return cmp; + /* + * Move 'R'ename entries last so that all references of the file + * appear in the output before it is renamed (e.g., when a file + * was copied and renamed in the same commit). + */ + return (a->status == 'R') - (b->status == 'R'); } static void show_filemodify(struct diff_queue_struct *q, |