Commit e229e90d75bf7cb28e28509d8504f687a49722c8

Patrick Steinhardt 2018-02-20T10:03:48

tests: add rename-rewrite scenarios to "renames" repository Add two more scenarios to the "renames" repository. The first scenario has a major rewrite of a file and a delete of another file, the second scenario has a deletion of a file and rename of another file to the deleted file. Both scenarios will be used in the following commit.

diff --git a/tests/diff/rename.c b/tests/diff/rename.c
index 81f2d77..3625d68 100644
--- a/tests/diff/rename.c
+++ b/tests/diff/rename.c
@@ -20,6 +20,8 @@ void test_diff_rename__cleanup(void)
 #define COPY_RENAME_COMMIT "2bc7f351d20b53f1c72c16c4b036e491c478c49a"
 #define REWRITE_COPY_COMMIT "1c068dee5790ef1580cfc4cd670915b48d790084"
 #define RENAME_MODIFICATION_COMMIT "19dd32dfb1520a64e5bbaae8dce6ef423dfa2f13"
+#define REWRITE_DELETE_COMMIT "84d8efa38af7ace2b302de0adbda16b1f1cd2e1b"
+#define DELETE_RENAME_COMMIT "be053a189b0bbde545e0a3f59ce00b46ad29ce0d"
 
 /*
  * Renames repo has:
@@ -41,6 +43,16 @@ void test_diff_rename__cleanup(void)
  *   ikeepsix.txt    -> ikeepsix.txt    (reorder sections in file)
  *   sixserving.txt  -> sixserving.txt  (whitespace change - not just indent)
  *   sevencities.txt -> songof7cities.txt (rename, small text changes)
+ * commit 84d8efa38af7ace2b302de0adbda16b1f1cd2e1b
+ *   songof7cities.txt -> songof7citie.txt (major rewrite, <20% match)
+ *   ikeepsix.txt      ->                  (deleted)
+ *   untimely.txt                          (no change)
+ *   sixserving.txt                        (no change)
+ * commit be053a189b0bbde545e0a3f59ce00b46ad29ce0d
+ *   ikeepsix.txt      ->              (deleted)
+ *   songof7cities.txt -> ikeepsix.txt (rename, 100% match)
+ *   untimely.txt                      (no change)
+ *   sixserving.txt                    (no change)
  */
 
 void test_diff_rename__match_oid(void)
diff --git a/tests/resources/renames/.gitted/objects/2c/136d294960f7d939f1ed1903f1ced78b874c87 b/tests/resources/renames/.gitted/objects/2c/136d294960f7d939f1ed1903f1ced78b874c87
new file mode 100644
index 0000000..51b7cea
Binary files /dev/null and b/tests/resources/renames/.gitted/objects/2c/136d294960f7d939f1ed1903f1ced78b874c87 differ
diff --git a/tests/resources/renames/.gitted/objects/84/d8efa38af7ace2b302de0adbda16b1f1cd2e1b b/tests/resources/renames/.gitted/objects/84/d8efa38af7ace2b302de0adbda16b1f1cd2e1b
new file mode 100644
index 0000000..56f98fe
--- /dev/null
+++ b/tests/resources/renames/.gitted/objects/84/d8efa38af7ace2b302de0adbda16b1f1cd2e1b
@@ -0,0 +1 @@
+xQj0SX+۲ !4'XiHeCߐtgr_fZRT%*!q.&40.Of? )g,Z0>8y$[жt5:l'<BWH6%
uJI
\ No newline at end of file
diff --git a/tests/resources/renames/.gitted/objects/89/7dda8ecb7fa2e092bc3f9e2a179d7c1b0364db b/tests/resources/renames/.gitted/objects/89/7dda8ecb7fa2e092bc3f9e2a179d7c1b0364db
new file mode 100644
index 0000000..d104e66
Binary files /dev/null and b/tests/resources/renames/.gitted/objects/89/7dda8ecb7fa2e092bc3f9e2a179d7c1b0364db differ
diff --git a/tests/resources/renames/.gitted/objects/95/ceb126bf79e76020d8879a8b0d50a73307a97f b/tests/resources/renames/.gitted/objects/95/ceb126bf79e76020d8879a8b0d50a73307a97f
new file mode 100644
index 0000000..0486ba5
Binary files /dev/null and b/tests/resources/renames/.gitted/objects/95/ceb126bf79e76020d8879a8b0d50a73307a97f differ
diff --git a/tests/resources/renames/.gitted/objects/be/053a189b0bbde545e0a3f59ce00b46ad29ce0d b/tests/resources/renames/.gitted/objects/be/053a189b0bbde545e0a3f59ce00b46ad29ce0d
new file mode 100644
index 0000000..de7aceb
Binary files /dev/null and b/tests/resources/renames/.gitted/objects/be/053a189b0bbde545e0a3f59ce00b46ad29ce0d differ
diff --git a/tests/resources/renames/.gitted/refs/heads/delete-and-rename b/tests/resources/renames/.gitted/refs/heads/delete-and-rename
new file mode 100644
index 0000000..f27fc21
--- /dev/null
+++ b/tests/resources/renames/.gitted/refs/heads/delete-and-rename
@@ -0,0 +1 @@
+be053a189b0bbde545e0a3f59ce00b46ad29ce0d
diff --git a/tests/resources/renames/.gitted/refs/heads/rewrite-and-delete b/tests/resources/renames/.gitted/refs/heads/rewrite-and-delete
new file mode 100644
index 0000000..0c0ecad
--- /dev/null
+++ b/tests/resources/renames/.gitted/refs/heads/rewrite-and-delete
@@ -0,0 +1 @@
+84d8efa38af7ace2b302de0adbda16b1f1cd2e1b