Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 965e90e5e8..007bba6795 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -166,7 +166,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,