summaryrefslogtreecommitdiff
path: root/builtin/fast-export.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-09-08 15:54:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-09-08 15:54:01 (GMT)
commit9f44723d1a2c6a97306a7160deeab621e08bea7a (patch)
tree0ad4ae4a8de137be14011c8b7f3b8c01875ce997 /builtin/fast-export.c
parent7505ae272bad53c6451f34ff5f04ad24f29b6dd9 (diff)
parent4ce6fb805803cd9bf82c08c84a2fdc8cd6bae8ef (diff)
downloadgit-9f44723d1a2c6a97306a7160deeab621e08bea7a.zip
git-9f44723d1a2c6a97306a7160deeab621e08bea7a.tar.gz
git-9f44723d1a2c6a97306a7160deeab621e08bea7a.tar.bz2
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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index a9bbf86..c8fd46b 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,