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/fast-export.c | |
parent | 7505ae272bad53c6451f34ff5f04ad24f29b6dd9 (diff) | |
parent | 4ce6fb805803cd9bf82c08c84a2fdc8cd6bae8ef (diff) | |
download | git-9f44723d1a2c6a97306a7160deeab621e08bea7a.tar.gz git-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/fast-export.c')
-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 a9bbf8653..c8fd46b87 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, |