]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'en/d-f-conflict-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 8 Sep 2010 15:54:01 +0000 (08:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Sep 2010 15:54:01 +0000 (08:54 -0700)
* en/d-f-conflict-fix:
  fast-export: ensure that a renamed file is printed after all references

builtin/fast-export.c

index a9bbf8653d1a8fa704a38c06102ec3ace4a59a28..c8fd46b872780b27b09ad70316fa164d855f3220 100644 (file)
@@ -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,