Added cherry pick tests
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077
diff --git a/tests/cherrypick/bare.c b/tests/cherrypick/bare.c
new file mode 100644
index 0000000..7ac1054
--- /dev/null
+++ b/tests/cherrypick/bare.c
@@ -0,0 +1,106 @@
+#include "clar.h"
+#include "clar_libgit2.h"
+
+#include "buffer.h"
+#include "fileops.h"
+#include "git2/cherrypick.h"
+
+#include "../merge/merge_helpers.h"
+
+#define TEST_REPO_PATH "cherrypick"
+
+static git_repository *repo;
+
+void test_cherrypick_bare__initialize(void)
+{
+ repo = cl_git_sandbox_init(TEST_REPO_PATH);
+}
+
+void test_cherrypick_bare__cleanup(void)
+{
+ cl_git_sandbox_cleanup();
+}
+
+void test_cherrypick_bare__automerge(void)
+{
+ git_commit *head = NULL, *commit = NULL;
+ git_index *index = NULL;
+ git_oid head_oid, cherry_oid;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "38c05a857e831a7e759d83778bfc85d003e21c45", 0, "file1.txt" },
+ { 0100644, "a661b5dec1004e2c62654ded3762370c27cf266b", 0, "file2.txt" },
+ { 0100644, "df6b290e0bd6a89b01d69f66687e8abf385283ca", 0, "file3.txt" },
+ };
+
+ git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e");
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+
+ git_oid_fromstr(&cherry_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+
+ cl_git_pass(git_cherry_pick_commit(&index, repo, commit, head, 0, NULL));
+ cl_assert(merge_test_index(index, merge_index_entries, 3));
+
+ git_index_free(index);
+ git_commit_free(head);
+ git_commit_free(commit);
+}
+
+void test_cherrypick_bare__conflicts(void)
+{
+ git_commit *head = NULL, *commit = NULL;
+ git_index *index = NULL;
+ git_oid head_oid, cherry_oid;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "242e7977ba73637822ffb265b46004b9b0e5153b", 0, "file1.txt" },
+ { 0100644, "a58ca3fee5eb68b11adc2703e5843f968c9dad1e", 1, "file2.txt" },
+ { 0100644, "bd6ffc8c6c41f0f85ff9e3d61c9479516bac0024", 2, "file2.txt" },
+ { 0100644, "563f6473a3858f99b80e5f93c660512ed38e1e6f", 3, "file2.txt" },
+ { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 1, "file3.txt" },
+ { 0100644, "1124c2c1ae07b26fded662d6c3f3631d9dc16f88", 2, "file3.txt" },
+ { 0100644, "e233b9ed408a95e9d4b65fec7fc34943a556deb2", 3, "file3.txt" },
+ };
+
+ git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8");
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+
+ git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+
+ cl_git_pass(git_cherry_pick_commit(&index, repo, commit, head, 0, NULL));
+ cl_assert(merge_test_index(index, merge_index_entries, 7));
+
+ git_index_free(index);
+ git_commit_free(head);
+ git_commit_free(commit);
+}
+
+void test_cherrypick_bare__orphan(void)
+{
+ git_commit *head = NULL, *commit = NULL;
+ git_index *index = NULL;
+ git_oid head_oid, cherry_oid;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "38c05a857e831a7e759d83778bfc85d003e21c45", 0, "file1.txt" },
+ { 0100644, "a661b5dec1004e2c62654ded3762370c27cf266b", 0, "file2.txt" },
+ { 0100644, "85a4a1d791973644f24c72f5e89420d3064cc452", 0, "file3.txt" },
+ { 0100644, "9ccb9bf50c011fd58dcbaa65df917bf79539717f", 0, "orphan.txt" },
+ };
+
+ git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e");
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+
+ git_oid_fromstr(&cherry_oid, "74f06b5bfec6d33d7264f73606b57a7c0b963819");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+
+ cl_git_pass(git_cherry_pick_commit(&index, repo, commit, head, 0, NULL));
+ cl_assert(merge_test_index(index, merge_index_entries, 4));
+
+ git_index_free(index);
+ git_commit_free(head);
+ git_commit_free(commit);
+}
+
diff --git a/tests/cherrypick/workdir.c b/tests/cherrypick/workdir.c
new file mode 100644
index 0000000..581a5f9
--- /dev/null
+++ b/tests/cherrypick/workdir.c
@@ -0,0 +1,429 @@
+#include "clar.h"
+#include "clar_libgit2.h"
+
+#include "buffer.h"
+#include "fileops.h"
+#include "git2/cherrypick.h"
+
+#include "../merge/merge_helpers.h"
+
+#define TEST_REPO_PATH "cherrypick"
+
+static git_repository *repo;
+static git_index *repo_index;
+
+// Fixture setup and teardown
+void test_cherrypick_workdir__initialize(void)
+{
+ repo = cl_git_sandbox_init(TEST_REPO_PATH);
+ git_repository_index(&repo_index, repo);
+}
+
+void test_cherrypick_workdir__cleanup(void)
+{
+ git_index_free(repo_index);
+ cl_git_sandbox_cleanup();
+}
+
+/* git reset --hard d3d77487660ee3c0194ee01dc5eaf478782b1c7e
+ * git cherry-pick cfc4f0999a8367568e049af4f72e452d40828a15
+ * git cherry-pick 964ea3da044d9083181a88ba6701de9e35778bf4
+ * git cherry-pick a43a050c588d4e92f11a6b139680923e9728477d
+ */
+void test_cherrypick_workdir__automerge(void)
+{
+ git_oid head_oid;
+ git_signature *signature = NULL;
+ size_t i;
+
+ const char *cherry_pick_oids[] = {
+ "cfc4f0999a8367568e049af4f72e452d40828a15",
+ "964ea3da044d9083181a88ba6701de9e35778bf4",
+ "a43a050c588d4e92f11a6b139680923e9728477d",
+ };
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "38c05a857e831a7e759d83778bfc85d003e21c45", 0, "file1.txt" },
+ { 0100644, "a661b5dec1004e2c62654ded3762370c27cf266b", 0, "file2.txt" },
+ { 0100644, "df6b290e0bd6a89b01d69f66687e8abf385283ca", 0, "file3.txt" },
+
+ { 0100644, "38c05a857e831a7e759d83778bfc85d003e21c45", 0, "file1.txt" },
+ { 0100644, "bd8fc3c59fb52d3c8b5907ace7defa5803f82419", 0, "file2.txt" },
+ { 0100644, "df6b290e0bd6a89b01d69f66687e8abf385283ca", 0, "file3.txt" },
+
+ { 0100644, "f06427bee380364bc7e0cb26a9245158e4726ce0", 0, "file1.txt" },
+ { 0100644, "bd8fc3c59fb52d3c8b5907ace7defa5803f82419", 0, "file2.txt" },
+ { 0100644, "df6b290e0bd6a89b01d69f66687e8abf385283ca", 0, "file3.txt" },
+ };
+
+ cl_git_pass(git_signature_new(&signature, "Picker", "picker@example.org", time(NULL), 0));
+
+ git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e");
+
+ for (i = 0; i < 3; ++i) {
+ git_commit *head = NULL, *commit = NULL;
+ git_oid cherry_oid, cherry_picked_oid, cherry_picked_tree_oid;
+ git_tree *cherry_picked_tree = NULL;
+
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+
+ git_oid_fromstr(&cherry_oid, cherry_pick_oids[i]);
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+ cl_git_pass(git_cherry_pick(repo, commit, NULL));
+
+ cl_assert(git_path_exists(TEST_REPO_PATH "/.git/CHERRY_PICK_HEAD"));
+ cl_assert(git_path_exists(TEST_REPO_PATH "/.git/MERGE_MSG"));
+
+ cl_git_pass(git_index_write_tree(&cherry_picked_tree_oid, repo_index));
+ cl_git_pass(git_tree_lookup(&cherry_picked_tree, repo, &cherry_picked_tree_oid));
+ cl_git_pass(git_commit_create(&cherry_picked_oid, repo, "HEAD", signature, signature, NULL,
+ "Cherry picked!", cherry_picked_tree, 1, (const git_commit **)&head));
+
+ cl_assert(merge_test_index(repo_index, merge_index_entries + i * 3, 3));
+
+ git_oid_cpy(&head_oid, &cherry_picked_oid);
+
+ git_tree_free(cherry_picked_tree);
+ git_commit_free(head);
+ git_commit_free(commit);
+ }
+
+ git_signature_free(signature);
+}
+
+/* git reset --hard bafbf6912c09505ac60575cd43d3f2aba3bd84d8
+ * git cherry-pick e9b63f3655b2ad80c0ff587389b5a9589a3a7110
+ */
+void test_cherrypick_workdir__conflicts(void)
+{
+ git_commit *head = NULL, *commit = NULL;
+ git_oid head_oid, cherry_oid;
+ git_buf conflicting_buf = GIT_BUF_INIT, mergemsg_buf = GIT_BUF_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "242e7977ba73637822ffb265b46004b9b0e5153b", 0, "file1.txt" },
+ { 0100644, "a58ca3fee5eb68b11adc2703e5843f968c9dad1e", 1, "file2.txt" },
+ { 0100644, "bd6ffc8c6c41f0f85ff9e3d61c9479516bac0024", 2, "file2.txt" },
+ { 0100644, "563f6473a3858f99b80e5f93c660512ed38e1e6f", 3, "file2.txt" },
+ { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 1, "file3.txt" },
+ { 0100644, "1124c2c1ae07b26fded662d6c3f3631d9dc16f88", 2, "file3.txt" },
+ { 0100644, "e233b9ed408a95e9d4b65fec7fc34943a556deb2", 3, "file3.txt" },
+ };
+
+ git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8");
+
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+
+ git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+ cl_git_pass(git_cherry_pick(repo, commit, NULL));
+
+ cl_assert(git_path_exists(TEST_REPO_PATH "/.git/CHERRY_PICK_HEAD"));
+ cl_assert(git_path_exists(TEST_REPO_PATH "/.git/MERGE_MSG"));
+
+ cl_assert(merge_test_index(repo_index, merge_index_entries, 7));
+
+ cl_git_pass(git_futils_readbuffer(&mergemsg_buf,
+ TEST_REPO_PATH "/.git/MERGE_MSG"));
+ cl_assert(strcmp(git_buf_cstr(&mergemsg_buf),
+ "Change all files\n" \
+ "\n" \
+ "Conflicts:\n" \
+ "\tfile2.txt\n" \
+ "\tfile3.txt\n") == 0);
+
+ cl_git_pass(git_futils_readbuffer(&conflicting_buf,
+ TEST_REPO_PATH "/file2.txt"));
+
+ cl_assert(strcmp(git_buf_cstr(&conflicting_buf),
+ "!File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2!!\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "File 2\n" \
+ "<<<<<<< HEAD\n" \
+ "File 2\n" \
+ "=======\n" \
+ "File 2!\n" \
+ "File 2\n" \
+ "File 2!\n" \
+ ">>>>>>> e9b63f3... Change all files\n") == 0);
+
+ cl_git_pass(git_futils_readbuffer(&conflicting_buf,
+ TEST_REPO_PATH "/file3.txt"));
+
+ cl_assert(strcmp(git_buf_cstr(&conflicting_buf),
+ "!File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3!!\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "File 3\n" \
+ "<<<<<<< HEAD\n" \
+ "=======\n" \
+ "File 3!\n" \
+ "File 3!\n" \
+ ">>>>>>> e9b63f3... Change all files\n") == 0);
+
+ git_commit_free(commit);
+ git_commit_free(head);
+ git_buf_free(&mergemsg_buf);
+ git_buf_free(&conflicting_buf);
+}
+
+/* git reset --hard bafbf6912c09505ac60575cd43d3f2aba3bd84d8
+ * git cherry-pick -X ours e9b63f3655b2ad80c0ff587389b5a9589a3a7110
+ */
+void test_cherrypick_workdir__conflict_use_ours(void)
+{
+ git_commit *head = NULL, *commit = NULL;
+ git_oid head_oid, cherry_oid;
+ git_cherry_pick_options opts = GIT_CHERRY_PICK_OPTIONS_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "242e7977ba73637822ffb265b46004b9b0e5153b", 0, "file1.txt" },
+ { 0100644, "a58ca3fee5eb68b11adc2703e5843f968c9dad1e", 1, "file2.txt" },
+ { 0100644, "bd6ffc8c6c41f0f85ff9e3d61c9479516bac0024", 2, "file2.txt" },
+ { 0100644, "563f6473a3858f99b80e5f93c660512ed38e1e6f", 3, "file2.txt" },
+ { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 1, "file3.txt" },
+ { 0100644, "1124c2c1ae07b26fded662d6c3f3631d9dc16f88", 2, "file3.txt" },
+ { 0100644, "e233b9ed408a95e9d4b65fec7fc34943a556deb2", 3, "file3.txt" },
+ };
+
+ struct merge_index_entry merge_filesystem_entries[] = {
+ { 0100644, "242e7977ba73637822ffb265b46004b9b0e5153b", 0, "file1.txt" },
+ { 0100644, "bd6ffc8c6c41f0f85ff9e3d61c9479516bac0024", 0, "file2.txt" },
+ { 0100644, "1124c2c1ae07b26fded662d6c3f3631d9dc16f88", 0, "file3.txt" },
+ };
+
+ /* leave the index in a conflicted state, but checkout "ours" to the workdir */
+ opts.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS;
+
+ git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8");
+
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+
+ git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+ cl_git_pass(git_cherry_pick(repo, commit, &opts));
+
+ cl_assert(merge_test_index(repo_index, merge_index_entries, 7));
+ cl_assert(merge_test_workdir(repo, merge_filesystem_entries, 3));
+
+ /* resolve conflicts in the index by taking "ours" */
+ opts.merge_opts.file_favor = GIT_MERGE_FILE_FAVOR_OURS;
+
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+ cl_git_pass(git_cherry_pick(repo, commit, &opts));
+
+ cl_assert(merge_test_index(repo_index, merge_filesystem_entries, 3));
+ cl_assert(merge_test_workdir(repo, merge_filesystem_entries, 3));
+
+ git_commit_free(commit);
+ git_commit_free(head);
+}
+
+/* git reset --hard cfc4f0999a8367568e049af4f72e452d40828a15
+ * git cherry-pick 2a26c7e88b285613b302ba76712bc998863f3cbc
+ */
+void test_cherrypick_workdir__rename(void)
+{
+ git_commit *head, *commit;
+ git_oid head_oid, cherry_oid;
+ git_cherry_pick_options opts = GIT_CHERRY_PICK_OPTIONS_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "19c5c7207054604b69c84d08a7571ef9672bb5c2", 0, "file1.txt" },
+ { 0100644, "a58ca3fee5eb68b11adc2703e5843f968c9dad1e", 0, "file2.txt" },
+ { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 0, "file3.txt.renamed" },
+ };
+
+ opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+ opts.merge_opts.rename_threshold = 50;
+
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+
+ git_oid_fromstr(&cherry_oid, "2a26c7e88b285613b302ba76712bc998863f3cbc");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+ cl_git_pass(git_cherry_pick(repo, commit, &opts));
+
+ cl_assert(merge_test_index(repo_index, merge_index_entries, 3));
+
+ git_commit_free(commit);
+ git_commit_free(head);
+}
+
+/* git reset --hard 44cd2ed2052c9c68f9a439d208e9614dc2a55c70
+ * git cherry-pick 2a26c7e88b285613b302ba76712bc998863f3cbc
+ */
+void test_cherrypick_workdir__both_renamed(void)
+{
+ git_commit *head, *commit;
+ git_oid head_oid, cherry_oid;
+ git_buf mergemsg_buf = GIT_BUF_INIT;
+ git_cherry_pick_options opts = GIT_CHERRY_PICK_OPTIONS_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "19c5c7207054604b69c84d08a7571ef9672bb5c2", 0, "file1.txt" },
+ { 0100644, "a58ca3fee5eb68b11adc2703e5843f968c9dad1e", 0, "file2.txt" },
+ { 0100644, "e233b9ed408a95e9d4b65fec7fc34943a556deb2", 1, "file3.txt" },
+ { 0100644, "e233b9ed408a95e9d4b65fec7fc34943a556deb2", 3, "file3.txt.renamed" },
+ { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 2, "file3.txt.renamed_on_branch" },
+ };
+
+ opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+ opts.merge_opts.rename_threshold = 50;
+
+ git_oid_fromstr(&head_oid, "44cd2ed2052c9c68f9a439d208e9614dc2a55c70");
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+
+ git_oid_fromstr(&cherry_oid, "2a26c7e88b285613b302ba76712bc998863f3cbc");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+ cl_git_pass(git_cherry_pick(repo, commit, &opts));
+
+ cl_assert(merge_test_index(repo_index, merge_index_entries, 5));
+
+ cl_git_pass(git_futils_readbuffer(&mergemsg_buf,
+ TEST_REPO_PATH "/.git/MERGE_MSG"));
+ cl_assert(strcmp(git_buf_cstr(&mergemsg_buf),
+ "Renamed file3.txt -> file3.txt.renamed\n" \
+ "\n" \
+ "Conflicts:\n" \
+ "\tfile3.txt\n" \
+ "\tfile3.txt.renamed\n" \
+ "\tfile3.txt.renamed_on_branch\n") == 0);
+
+ git_buf_free(&mergemsg_buf);
+ git_commit_free(commit);
+ git_commit_free(head);
+}
+
+void test_cherrypick_workdir__nonmerge_fails_mainline_specified(void)
+{
+ git_reference *head;
+ git_commit *commit;
+ git_cherry_pick_options opts = GIT_CHERRY_PICK_OPTIONS_INIT;
+
+ cl_git_pass(git_repository_head(&head, repo));
+ cl_git_pass(git_reference_peel((git_object **)&commit, head, GIT_OBJ_COMMIT));
+
+ opts.mainline = 1;
+ cl_must_fail(git_cherry_pick(repo, commit, &opts));
+ cl_assert(!git_path_exists(TEST_REPO_PATH "/.git/CHERRY_PICK_HEAD"));
+ cl_assert(!git_path_exists(TEST_REPO_PATH "/.git/MERGE_MSG"));
+
+ git_reference_free(head);
+ git_commit_free(commit);
+}
+
+/* git reset --hard cfc4f0999a8367568e049af4f72e452d40828a15
+ * git cherry-pick abe4603bc7cd5b8167a267e0e2418fd2348f8cff
+ */
+void test_cherrypick_workdir__merge_fails_without_mainline_specified(void)
+{
+ git_commit *head, *commit;
+ git_oid head_oid, cherry_oid;
+
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+
+ git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+
+ cl_must_fail(git_cherry_pick(repo, commit, NULL));
+ cl_assert(!git_path_exists(TEST_REPO_PATH "/.git/CHERRY_PICK_HEAD"));
+ cl_assert(!git_path_exists(TEST_REPO_PATH "/.git/MERGE_MSG"));
+
+ git_commit_free(commit);
+ git_commit_free(head);
+}
+
+/* git reset --hard cfc4f0999a8367568e049af4f72e452d40828a15
+ * git cherry-pick -m1 abe4603bc7cd5b8167a267e0e2418fd2348f8cff
+ */
+void test_cherrypick_workdir__merge_first_parent(void)
+{
+ git_commit *head, *commit;
+ git_oid head_oid, cherry_oid;
+ git_cherry_pick_options opts = GIT_CHERRY_PICK_OPTIONS_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "f90f9dcbdac2cce5cc166346160e19cb693ef4e8", 0, "file1.txt" },
+ { 0100644, "563f6473a3858f99b80e5f93c660512ed38e1e6f", 0, "file2.txt" },
+ { 0100644, "e233b9ed408a95e9d4b65fec7fc34943a556deb2", 0, "file3.txt" },
+ };
+
+ opts.mainline = 1;
+
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+
+ git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+
+ cl_git_pass(git_cherry_pick(repo, commit, &opts));
+
+ cl_assert(merge_test_index(repo_index, merge_index_entries, 3));
+
+ git_commit_free(commit);
+ git_commit_free(head);
+}
+
+/* git reset --hard cfc4f0999a8367568e049af4f72e452d40828a15
+ * git cherry-pick -m2 abe4603bc7cd5b8167a267e0e2418fd2348f8cff
+ */
+void test_cherrypick_workdir__merge_second_parent(void)
+{
+ git_commit *head, *commit;
+ git_oid head_oid, cherry_oid;
+ git_cherry_pick_options opts = GIT_CHERRY_PICK_OPTIONS_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "487434cace79238a7091e2220611d4f20a765690", 0, "file1.txt" },
+ { 0100644, "e5183bfd18e3a0a691fadde2f0d5610b73282d31", 0, "file2.txt" },
+ { 0100644, "409a1bec58bf35348e8b62b72bb9c1f45cf5a587", 0, "file3.txt" },
+ };
+
+ opts.mainline = 2;
+
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
+ cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL));
+
+ git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff");
+ cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
+
+ cl_git_pass(git_cherry_pick(repo, commit, &opts));
+
+ cl_assert(merge_test_index(repo_index, merge_index_entries, 3));
+
+ git_commit_free(commit);
+ git_commit_free(head);
+}
+
diff --git a/tests/resources/cherrypick/.gitted/HEAD b/tests/resources/cherrypick/.gitted/HEAD
new file mode 100644
index 0000000..656ac0e
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/HEAD
@@ -0,0 +1 @@
+ref: refs/heads/automerge-branch
diff --git a/tests/resources/cherrypick/.gitted/config b/tests/resources/cherrypick/.gitted/config
new file mode 100644
index 0000000..6c9406b
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/config
@@ -0,0 +1,7 @@
+[core]
+ repositoryformatversion = 0
+ filemode = true
+ bare = false
+ logallrefupdates = true
+ ignorecase = true
+ precomposeunicode = true
diff --git a/tests/resources/cherrypick/.gitted/index b/tests/resources/cherrypick/.gitted/index
new file mode 100644
index 0000000..7291006
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/index differ
diff --git a/tests/resources/cherrypick/.gitted/info/exclude b/tests/resources/cherrypick/.gitted/info/exclude
new file mode 100644
index 0000000..a5196d1
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/info/exclude
@@ -0,0 +1,6 @@
+# git ls-files --others --exclude-from=.git/info/exclude
+# Lines that start with '#' are comments.
+# For a project mostly in C, the following would be a good set of
+# exclude patterns (uncomment them if you want to use them):
+# *.[oa]
+# *~
diff --git a/tests/resources/cherrypick/.gitted/objects/01/a2b453c2647c71ccfefc285f2266d1f00b8253 b/tests/resources/cherrypick/.gitted/objects/01/a2b453c2647c71ccfefc285f2266d1f00b8253
new file mode 100644
index 0000000..736a7f5
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/01/a2b453c2647c71ccfefc285f2266d1f00b8253 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/02/67838e09bbc5969bba035be2d27c8a6de694d8 b/tests/resources/cherrypick/.gitted/objects/02/67838e09bbc5969bba035be2d27c8a6de694d8
new file mode 100644
index 0000000..4eacb26
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/02/67838e09bbc5969bba035be2d27c8a6de694d8 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/06/3fc9f01e6e9ec2a8d8f749885e931875e50d37 b/tests/resources/cherrypick/.gitted/objects/06/3fc9f01e6e9ec2a8d8f749885e931875e50d37
new file mode 100644
index 0000000..48fa6ef
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/06/3fc9f01e6e9ec2a8d8f749885e931875e50d37 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/08/9ac03f76058b5ba0b44bb268f317f9242481e9 b/tests/resources/cherrypick/.gitted/objects/08/9ac03f76058b5ba0b44bb268f317f9242481e9
new file mode 100644
index 0000000..06d1c69
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/08/9ac03f76058b5ba0b44bb268f317f9242481e9
@@ -0,0 +1,3 @@
+xA
+0@Q9i"`LBMӅܾ)籂#բ
+^CNb+%bRU!z1Jh)JO}딼b>WI\qyϟ
祖QҔO`D6{tfm_sy@2("O-
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/0d/447a6c2528b06616cde3b209a4b4ea3dcb8d65 b/tests/resources/cherrypick/.gitted/objects/0d/447a6c2528b06616cde3b209a4b4ea3dcb8d65
new file mode 100644
index 0000000..9a3ea32
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/0d/447a6c2528b06616cde3b209a4b4ea3dcb8d65 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/11/24c2c1ae07b26fded662d6c3f3631d9dc16f88 b/tests/resources/cherrypick/.gitted/objects/11/24c2c1ae07b26fded662d6c3f3631d9dc16f88
new file mode 100644
index 0000000..62abc3c
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/11/24c2c1ae07b26fded662d6c3f3631d9dc16f88 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/12/905f4ea5b76f9d3fdcfe73e462201c06ae632a b/tests/resources/cherrypick/.gitted/objects/12/905f4ea5b76f9d3fdcfe73e462201c06ae632a
new file mode 100644
index 0000000..162844a
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/12/905f4ea5b76f9d3fdcfe73e462201c06ae632a differ
diff --git a/tests/resources/cherrypick/.gitted/objects/19/c5c7207054604b69c84d08a7571ef9672bb5c2 b/tests/resources/cherrypick/.gitted/objects/19/c5c7207054604b69c84d08a7571ef9672bb5c2
new file mode 100644
index 0000000..d5cd6d3
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/19/c5c7207054604b69c84d08a7571ef9672bb5c2 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/1c/2116845780455ecf916538c1cc27c4222452af b/tests/resources/cherrypick/.gitted/objects/1c/2116845780455ecf916538c1cc27c4222452af
new file mode 100644
index 0000000..f9a841d
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/1c/2116845780455ecf916538c1cc27c4222452af differ
diff --git a/tests/resources/cherrypick/.gitted/objects/1c/c85eb4ff0a8438fde1b14274c6f87f891b36a0 b/tests/resources/cherrypick/.gitted/objects/1c/c85eb4ff0a8438fde1b14274c6f87f891b36a0
new file mode 100644
index 0000000..98b792b
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/1c/c85eb4ff0a8438fde1b14274c6f87f891b36a0 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/1e/1cb7391d25dcd8daba88f1f627f3045982286c b/tests/resources/cherrypick/.gitted/objects/1e/1cb7391d25dcd8daba88f1f627f3045982286c
new file mode 100644
index 0000000..10a5be6
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/1e/1cb7391d25dcd8daba88f1f627f3045982286c differ
diff --git a/tests/resources/cherrypick/.gitted/objects/20/fc1a4c9d994021f43d33ab75e4252e27ca661d b/tests/resources/cherrypick/.gitted/objects/20/fc1a4c9d994021f43d33ab75e4252e27ca661d
new file mode 100644
index 0000000..c8b26cd
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/20/fc1a4c9d994021f43d33ab75e4252e27ca661d differ
diff --git a/tests/resources/cherrypick/.gitted/objects/28/d9eb4208074ad1cc84e71ccc908b34573f05d2 b/tests/resources/cherrypick/.gitted/objects/28/d9eb4208074ad1cc84e71ccc908b34573f05d2
new file mode 100644
index 0000000..80363b0
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/28/d9eb4208074ad1cc84e71ccc908b34573f05d2 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/2a/26c7e88b285613b302ba76712bc998863f3cbc b/tests/resources/cherrypick/.gitted/objects/2a/26c7e88b285613b302ba76712bc998863f3cbc
new file mode 100644
index 0000000..2831139
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/2a/26c7e88b285613b302ba76712bc998863f3cbc
@@ -0,0 +1 @@
+xMj0)f_j]`$*N1C=@{^YZlLOҙUzub/X1"iuWN9b҄ZS&r4mrY:Qo+6{/{?gҎ`\k-<k>U_u+5Οx9a?7W
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/2a/c3b376093de405b0a951bff578655b1c2b7fa1 b/tests/resources/cherrypick/.gitted/objects/2a/c3b376093de405b0a951bff578655b1c2b7fa1
new file mode 100644
index 0000000..a3294d7
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/2a/c3b376093de405b0a951bff578655b1c2b7fa1
@@ -0,0 +1 @@
+xJ0E]+fIwGLkܞ{VG{כ*A9Ěc:PܔCJBk\2]}jPQD6b95xuO7v}{[c3ޢԮ#E̻yɚgToPM/X
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/2c/acbcaabf785f1ac231e8519849d4ad38692f2c b/tests/resources/cherrypick/.gitted/objects/2c/acbcaabf785f1ac231e8519849d4ad38692f2c
new file mode 100644
index 0000000..74b48dd
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/2c/acbcaabf785f1ac231e8519849d4ad38692f2c differ
diff --git a/tests/resources/cherrypick/.gitted/objects/35/cb210149022c7379b0a67b0dec13cc628ff87d b/tests/resources/cherrypick/.gitted/objects/35/cb210149022c7379b0a67b0dec13cc628ff87d
new file mode 100644
index 0000000..c0466f4
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/35/cb210149022c7379b0a67b0dec13cc628ff87d differ
diff --git a/tests/resources/cherrypick/.gitted/objects/38/c05a857e831a7e759d83778bfc85d003e21c45 b/tests/resources/cherrypick/.gitted/objects/38/c05a857e831a7e759d83778bfc85d003e21c45
new file mode 100644
index 0000000..d4f1cf8
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/38/c05a857e831a7e759d83778bfc85d003e21c45 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/3f/9eed8946df9e2c737d3b8dc0b8e78959aacd92 b/tests/resources/cherrypick/.gitted/objects/3f/9eed8946df9e2c737d3b8dc0b8e78959aacd92
new file mode 100644
index 0000000..8c4d6d9
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/3f/9eed8946df9e2c737d3b8dc0b8e78959aacd92
@@ -0,0 +1,5 @@
+xMj0)fjH]dԸDq#
+-t=YJ`HOt.DSJN.1I#gUo
$eR8ɇgj/F]
+,MW8j-zپVxyk37d){pc
+hn
+bNzgUǡ}6xz*V8
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/40/9a1bec58bf35348e8b62b72bb9c1f45cf5a587 b/tests/resources/cherrypick/.gitted/objects/40/9a1bec58bf35348e8b62b72bb9c1f45cf5a587
new file mode 100644
index 0000000..60d5dca
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/40/9a1bec58bf35348e8b62b72bb9c1f45cf5a587 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/44/cd2ed2052c9c68f9a439d208e9614dc2a55c70 b/tests/resources/cherrypick/.gitted/objects/44/cd2ed2052c9c68f9a439d208e9614dc2a55c70
new file mode 100644
index 0000000..8697c4e
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/44/cd2ed2052c9c68f9a439d208e9614dc2a55c70
@@ -0,0 +1 @@
+xN0C9+推$M$đX&i!M%{ gɲZpכ.0c$etBPpLꃛ,RITtA4E.TFrIlOkNl,۴oxcoO[o3wZO`lD.V=vWzd(ءux8O.K%M?Z
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/48/7434cace79238a7091e2220611d4f20a765690 b/tests/resources/cherrypick/.gitted/objects/48/7434cace79238a7091e2220611d4f20a765690
new file mode 100644
index 0000000..a1fa599
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/48/7434cace79238a7091e2220611d4f20a765690 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/49/20ad2f17162dcc8823ad491444dcb87f5899c9 b/tests/resources/cherrypick/.gitted/objects/49/20ad2f17162dcc8823ad491444dcb87f5899c9
new file mode 100644
index 0000000..bf96fcc
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/49/20ad2f17162dcc8823ad491444dcb87f5899c9 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/tests/resources/cherrypick/.gitted/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
new file mode 100644
index 0000000..adf6411
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/4c/532774cc1fea37f6efc2256763a64d38c8cdde b/tests/resources/cherrypick/.gitted/objects/4c/532774cc1fea37f6efc2256763a64d38c8cdde
new file mode 100644
index 0000000..2e56d74
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/4c/532774cc1fea37f6efc2256763a64d38c8cdde differ
diff --git a/tests/resources/cherrypick/.gitted/objects/51/145af30d411a50195b66517d825e69bf57ed22 b/tests/resources/cherrypick/.gitted/objects/51/145af30d411a50195b66517d825e69bf57ed22
new file mode 100644
index 0000000..3e01376
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/51/145af30d411a50195b66517d825e69bf57ed22 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/54/61de53ffadbf15be4dd6345997c15689573209 b/tests/resources/cherrypick/.gitted/objects/54/61de53ffadbf15be4dd6345997c15689573209
new file mode 100644
index 0000000..7d2b233
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/54/61de53ffadbf15be4dd6345997c15689573209
@@ -0,0 +1,4 @@
+xMj0)fjH]dԸDq#
+-t=YJ`HOt.DSJN.1I#gUo
$eR8ɇgj/F]
+,MW8j-zپVxyk37d){pc
+hn?Js=C:O#6V<
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/54/784f10955e92ab27e4fa832e40cb2baf1edbdc b/tests/resources/cherrypick/.gitted/objects/54/784f10955e92ab27e4fa832e40cb2baf1edbdc
new file mode 100644
index 0000000..2a5bcec
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/54/784f10955e92ab27e4fa832e40cb2baf1edbdc differ
diff --git a/tests/resources/cherrypick/.gitted/objects/56/3f6473a3858f99b80e5f93c660512ed38e1e6f b/tests/resources/cherrypick/.gitted/objects/56/3f6473a3858f99b80e5f93c660512ed38e1e6f
new file mode 100644
index 0000000..8847ed6
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/56/3f6473a3858f99b80e5f93c660512ed38e1e6f differ
diff --git a/tests/resources/cherrypick/.gitted/objects/58/a957ef0061c1a8ef995c855dfab4f5da8d6617 b/tests/resources/cherrypick/.gitted/objects/58/a957ef0061c1a8ef995c855dfab4f5da8d6617
new file mode 100644
index 0000000..f161a19
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/58/a957ef0061c1a8ef995c855dfab4f5da8d6617 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/5d/c7e1f440ce74d5503a0dfbc6c30e091475f774 b/tests/resources/cherrypick/.gitted/objects/5d/c7e1f440ce74d5503a0dfbc6c30e091475f774
new file mode 100644
index 0000000..77deeaf
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/5d/c7e1f440ce74d5503a0dfbc6c30e091475f774 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/5e/2206cda1c56430ad107a6866a829c159e0b9ea b/tests/resources/cherrypick/.gitted/objects/5e/2206cda1c56430ad107a6866a829c159e0b9ea
new file mode 100644
index 0000000..aa30f50
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/5e/2206cda1c56430ad107a6866a829c159e0b9ea
@@ -0,0 +1 @@
+x+)JMU044d040031QHI5+(aUE9s\uIXvKY;7nM3KdF"cx?35זzѨ1*
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/5f/77a2a13935ac62a629553f8944ad57b1ed8b4a b/tests/resources/cherrypick/.gitted/objects/5f/77a2a13935ac62a629553f8944ad57b1ed8b4a
new file mode 100644
index 0000000..5e622a1
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/5f/77a2a13935ac62a629553f8944ad57b1ed8b4a differ
diff --git a/tests/resources/cherrypick/.gitted/objects/63/c0d92b95253c4a40d3883f423a54be47d2c4c8 b/tests/resources/cherrypick/.gitted/objects/63/c0d92b95253c4a40d3883f423a54be47d2c4c8
new file mode 100644
index 0000000..eafe2c3
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/63/c0d92b95253c4a40d3883f423a54be47d2c4c8 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/6c/e83eb5f0fd34a10c3d25c6b36d2ed7ec0d6ce7 b/tests/resources/cherrypick/.gitted/objects/6c/e83eb5f0fd34a10c3d25c6b36d2ed7ec0d6ce7
new file mode 100644
index 0000000..1c1f503
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/6c/e83eb5f0fd34a10c3d25c6b36d2ed7ec0d6ce7 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/6d/1c2afe5eeb9e497528e2780ac468a5465cbc96 b/tests/resources/cherrypick/.gitted/objects/6d/1c2afe5eeb9e497528e2780ac468a5465cbc96
new file mode 100644
index 0000000..a98378a
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/6d/1c2afe5eeb9e497528e2780ac468a5465cbc96
@@ -0,0 +1 @@
+x=j@@{
fvLpgp3̎FժmҾɺ,s7U$ 1:HEc.d*1Qp5nzTh}A"I.SA:Hys}Z\YvminpymGYo`$DծBO{L|f^OA
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/74/f06b5bfec6d33d7264f73606b57a7c0b963819 b/tests/resources/cherrypick/.gitted/objects/74/f06b5bfec6d33d7264f73606b57a7c0b963819
new file mode 100644
index 0000000..732011f
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/74/f06b5bfec6d33d7264f73606b57a7c0b963819 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/82/8b08c52d2cba30952e0e008f60b25b5ba0d41a b/tests/resources/cherrypick/.gitted/objects/82/8b08c52d2cba30952e0e008f60b25b5ba0d41a
new file mode 100644
index 0000000..302014b
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/82/8b08c52d2cba30952e0e008f60b25b5ba0d41a differ
diff --git a/tests/resources/cherrypick/.gitted/objects/85/36dd6f0ec3ddecb9f9b6c8c64c6d322cd01211 b/tests/resources/cherrypick/.gitted/objects/85/36dd6f0ec3ddecb9f9b6c8c64c6d322cd01211
new file mode 100644
index 0000000..db6faa9
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/85/36dd6f0ec3ddecb9f9b6c8c64c6d322cd01211 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/85/a4a1d791973644f24c72f5e89420d3064cc452 b/tests/resources/cherrypick/.gitted/objects/85/a4a1d791973644f24c72f5e89420d3064cc452
new file mode 100644
index 0000000..7fe69b6
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/85/a4a1d791973644f24c72f5e89420d3064cc452 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/8b/5c30499a71001189b647f4d5b57fa8f04897ce b/tests/resources/cherrypick/.gitted/objects/8b/5c30499a71001189b647f4d5b57fa8f04897ce
new file mode 100644
index 0000000..8b1638f
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/8b/5c30499a71001189b647f4d5b57fa8f04897ce differ
diff --git a/tests/resources/cherrypick/.gitted/objects/96/4ea3da044d9083181a88ba6701de9e35778bf4 b/tests/resources/cherrypick/.gitted/objects/96/4ea3da044d9083181a88ba6701de9e35778bf4
new file mode 100644
index 0000000..2dec33f
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/96/4ea3da044d9083181a88ba6701de9e35778bf4 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/9c/c39fca3765a2facbe31157f7d60c2602193f36 b/tests/resources/cherrypick/.gitted/objects/9c/c39fca3765a2facbe31157f7d60c2602193f36
new file mode 100644
index 0000000..0031445
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/9c/c39fca3765a2facbe31157f7d60c2602193f36 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/9c/cb9bf50c011fd58dcbaa65df917bf79539717f b/tests/resources/cherrypick/.gitted/objects/9c/cb9bf50c011fd58dcbaa65df917bf79539717f
new file mode 100644
index 0000000..1266aff
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/9c/cb9bf50c011fd58dcbaa65df917bf79539717f differ
diff --git a/tests/resources/cherrypick/.gitted/objects/a1/0b59f4280491afe6e430c30654a7acc67d4a33 b/tests/resources/cherrypick/.gitted/objects/a1/0b59f4280491afe6e430c30654a7acc67d4a33
new file mode 100644
index 0000000..7aa0a5d
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/a1/0b59f4280491afe6e430c30654a7acc67d4a33 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/a2/1b4bfe7a04ab18024fb57f4ae9a52a1acef394 b/tests/resources/cherrypick/.gitted/objects/a2/1b4bfe7a04ab18024fb57f4ae9a52a1acef394
new file mode 100644
index 0000000..07b7195
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/a2/1b4bfe7a04ab18024fb57f4ae9a52a1acef394 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/a4/3a050c588d4e92f11a6b139680923e9728477d b/tests/resources/cherrypick/.gitted/objects/a4/3a050c588d4e92f11a6b139680923e9728477d
new file mode 100644
index 0000000..4713fb2
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/a4/3a050c588d4e92f11a6b139680923e9728477d
@@ -0,0 +1 @@
+xMj0uHBb4.J2G㽔qW9l=#`5GsDD5(ꋪlX!p!e$2N2{9IїWemו:y/om7pB]Qmw`^þA6 mT
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/a5/8ca3fee5eb68b11adc2703e5843f968c9dad1e b/tests/resources/cherrypick/.gitted/objects/a5/8ca3fee5eb68b11adc2703e5843f968c9dad1e
new file mode 100644
index 0000000..1c3f2fb
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/a5/8ca3fee5eb68b11adc2703e5843f968c9dad1e differ
diff --git a/tests/resources/cherrypick/.gitted/objects/a6/61b5dec1004e2c62654ded3762370c27cf266b b/tests/resources/cherrypick/.gitted/objects/a6/61b5dec1004e2c62654ded3762370c27cf266b
new file mode 100644
index 0000000..d94a954
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/a6/61b5dec1004e2c62654ded3762370c27cf266b differ
diff --git a/tests/resources/cherrypick/.gitted/objects/a6/9ef8fcbb9a2c509a7dbf4f23d257eb551d5610 b/tests/resources/cherrypick/.gitted/objects/a6/9ef8fcbb9a2c509a7dbf4f23d257eb551d5610
new file mode 100644
index 0000000..69feba2
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/a6/9ef8fcbb9a2c509a7dbf4f23d257eb551d5610
@@ -0,0 +1 @@
+x10@ѭuA,!] `,/hrǰGHKs՛*he8J*(&rTlJI$JD%YF}ipt:kot9楞`p)95]?}nsSnjGPOL
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/a8/3c6f70297b805dedc549e6583582966f6ebcab b/tests/resources/cherrypick/.gitted/objects/a8/3c6f70297b805dedc549e6583582966f6ebcab
new file mode 100644
index 0000000..5a6db50
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/a8/3c6f70297b805dedc549e6583582966f6ebcab differ
diff --git a/tests/resources/cherrypick/.gitted/objects/a9/020cd240774e4d672732bcb82d516d9685da76 b/tests/resources/cherrypick/.gitted/objects/a9/020cd240774e4d672732bcb82d516d9685da76
new file mode 100644
index 0000000..61741af
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/a9/020cd240774e4d672732bcb82d516d9685da76 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/ab/4115f808bc585b60f822da7020af86d20f62c8 b/tests/resources/cherrypick/.gitted/objects/ab/4115f808bc585b60f822da7020af86d20f62c8
new file mode 100644
index 0000000..08c4bef
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/ab/4115f808bc585b60f822da7020af86d20f62c8 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/ab/e4603bc7cd5b8167a267e0e2418fd2348f8cff b/tests/resources/cherrypick/.gitted/objects/ab/e4603bc7cd5b8167a267e0e2418fd2348f8cff
new file mode 100644
index 0000000..4e4fe6f
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/ab/e4603bc7cd5b8167a267e0e2418fd2348f8cff
@@ -0,0 +1,4 @@
+xKN0DY?B쐐8DӞHNqܞF'ƇT!`*<+,YZ
+%LވلM쓖X$N$S.cq89
+Dޚo{xFL)Ɣ}em]
^wv~z,&?iGz\//rS`^
+=ݣXfZ
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/b8/26e9b36e22e949ec885e7a1f3db496bbab6cd0 b/tests/resources/cherrypick/.gitted/objects/b8/26e9b36e22e949ec885e7a1f3db496bbab6cd0
new file mode 100644
index 0000000..e3bf3a0
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/b8/26e9b36e22e949ec885e7a1f3db496bbab6cd0 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/ba/fbf6912c09505ac60575cd43d3f2aba3bd84d8 b/tests/resources/cherrypick/.gitted/objects/ba/fbf6912c09505ac60575cd43d3f2aba3bd84d8
new file mode 100644
index 0000000..956da8b
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/ba/fbf6912c09505ac60575cd43d3f2aba3bd84d8 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/bb/14296ffa9dfbf935ec9ce2f9ed7808d952226b b/tests/resources/cherrypick/.gitted/objects/bb/14296ffa9dfbf935ec9ce2f9ed7808d952226b
new file mode 100644
index 0000000..b558368
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/bb/14296ffa9dfbf935ec9ce2f9ed7808d952226b differ
diff --git a/tests/resources/cherrypick/.gitted/objects/bc/4dd0744364d1db380a9811bd264c101065231e b/tests/resources/cherrypick/.gitted/objects/bc/4dd0744364d1db380a9811bd264c101065231e
new file mode 100644
index 0000000..01d88a2
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/bc/4dd0744364d1db380a9811bd264c101065231e differ
diff --git a/tests/resources/cherrypick/.gitted/objects/bd/65d4083845ed5ed4e1fe5feb85ac395d0760c8 b/tests/resources/cherrypick/.gitted/objects/bd/65d4083845ed5ed4e1fe5feb85ac395d0760c8
new file mode 100644
index 0000000..6a0eccb
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/bd/65d4083845ed5ed4e1fe5feb85ac395d0760c8
@@ -0,0 +1,2 @@
+xA
+B!֞bA6BD[o^@$ݾj-ڛtf]#":dKi51S@Rq:<b~Op^gmH/Q)z}jCpDvEK<
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/bd/6ffc8c6c41f0f85ff9e3d61c9479516bac0024 b/tests/resources/cherrypick/.gitted/objects/bd/6ffc8c6c41f0f85ff9e3d61c9479516bac0024
new file mode 100644
index 0000000..56f8367
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/bd/6ffc8c6c41f0f85ff9e3d61c9479516bac0024 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/bd/a51965cb36c0c5731c8cb50b80a36cac81018e b/tests/resources/cherrypick/.gitted/objects/bd/a51965cb36c0c5731c8cb50b80a36cac81018e
new file mode 100644
index 0000000..1187a70
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/bd/a51965cb36c0c5731c8cb50b80a36cac81018e differ
diff --git a/tests/resources/cherrypick/.gitted/objects/ce/d8fb81b6ec534d5deaf2a48b4b96c799712507 b/tests/resources/cherrypick/.gitted/objects/ce/d8fb81b6ec534d5deaf2a48b4b96c799712507
new file mode 100644
index 0000000..569ee0c
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/ce/d8fb81b6ec534d5deaf2a48b4b96c799712507
@@ -0,0 +1 @@
+xJ0@ay?] d2i+7)[~á6afYH1K%+E!(>q>qehM}P!:Cxεu!xXϟC>}ṟ,I炓ĥE9{0;KZq_˺Yt3V
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/cf/c4f0999a8367568e049af4f72e452d40828a15 b/tests/resources/cherrypick/.gitted/objects/cf/c4f0999a8367568e049af4f72e452d40828a15
new file mode 100644
index 0000000..d7deb0b
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/cf/c4f0999a8367568e049af4f72e452d40828a15 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/d0/f21e17beb5b9d953b1d8349049818a4f2edd1e b/tests/resources/cherrypick/.gitted/objects/d0/f21e17beb5b9d953b1d8349049818a4f2edd1e
new file mode 100644
index 0000000..65c846f
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/d0/f21e17beb5b9d953b1d8349049818a4f2edd1e
@@ -0,0 +1 @@
+xAj0E)f_,]z<]"!<^l4f=iM0Hir: <kiFGhI}S] 4F qfʚl蔵6svׯ[i ]R-7 uà:OI)p[!/=;&WY
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/d3/d77487660ee3c0194ee01dc5eaf478782b1c7e b/tests/resources/cherrypick/.gitted/objects/d3/d77487660ee3c0194ee01dc5eaf478782b1c7e
new file mode 100644
index 0000000..b42df7e
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/d3/d77487660ee3c0194ee01dc5eaf478782b1c7e
@@ -0,0 +1 @@
+xKJ1a9E!I@df%x!AooGp-~[[lO2AW
6Rّ=yFW@Փ5l(drXG[.cEKѻgmV!Pso0v*Wd
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/e2/33b9ed408a95e9d4b65fec7fc34943a556deb2 b/tests/resources/cherrypick/.gitted/objects/e2/33b9ed408a95e9d4b65fec7fc34943a556deb2
new file mode 100644
index 0000000..b344c9c
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/e2/33b9ed408a95e9d4b65fec7fc34943a556deb2 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/e5/183bfd18e3a0a691fadde2f0d5610b73282d31 b/tests/resources/cherrypick/.gitted/objects/e5/183bfd18e3a0a691fadde2f0d5610b73282d31
new file mode 100644
index 0000000..fdc0571
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/e5/183bfd18e3a0a691fadde2f0d5610b73282d31 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/e6/ae8889c40c77d7be02758235b5b3f7a4f2a129 b/tests/resources/cherrypick/.gitted/objects/e6/ae8889c40c77d7be02758235b5b3f7a4f2a129
new file mode 100644
index 0000000..3345907
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/e6/ae8889c40c77d7be02758235b5b3f7a4f2a129 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/e7/811a2bc55635f182750f0420da5ad232c1af91 b/tests/resources/cherrypick/.gitted/objects/e7/811a2bc55635f182750f0420da5ad232c1af91
new file mode 100644
index 0000000..2388730
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/e7/811a2bc55635f182750f0420da5ad232c1af91 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/e9/b63f3655b2ad80c0ff587389b5a9589a3a7110 b/tests/resources/cherrypick/.gitted/objects/e9/b63f3655b2ad80c0ff587389b5a9589a3a7110
new file mode 100644
index 0000000..ab0a27f
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/objects/e9/b63f3655b2ad80c0ff587389b5a9589a3a7110
@@ -0,0 +1,2 @@
+xMj0@u<!Eɣ?$/rzn}]HG+z"*k
+AHch]n
RN-3Kp~}PK,J=dz#G?Vֲu:NvVficO;iZjEu y^-P@
\ No newline at end of file
diff --git a/tests/resources/cherrypick/.gitted/objects/eb/da71fe44dcb60c53b8fbd53208a1204d32e959 b/tests/resources/cherrypick/.gitted/objects/eb/da71fe44dcb60c53b8fbd53208a1204d32e959
new file mode 100644
index 0000000..19d0c52
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/eb/da71fe44dcb60c53b8fbd53208a1204d32e959 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/f0/5ed049854c1596a7cc0e957fab34961077f3ae b/tests/resources/cherrypick/.gitted/objects/f0/5ed049854c1596a7cc0e957fab34961077f3ae
new file mode 100644
index 0000000..ab45439
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/f0/5ed049854c1596a7cc0e957fab34961077f3ae differ
diff --git a/tests/resources/cherrypick/.gitted/objects/f0/a4e1c66bb548cd2b22eebefda703872e969775 b/tests/resources/cherrypick/.gitted/objects/f0/a4e1c66bb548cd2b22eebefda703872e969775
new file mode 100644
index 0000000..558dd0a
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/f0/a4e1c66bb548cd2b22eebefda703872e969775 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/f2/ec8c8cf1a9fb7aa047a25a4308bfe860237ad4 b/tests/resources/cherrypick/.gitted/objects/f2/ec8c8cf1a9fb7aa047a25a4308bfe860237ad4
new file mode 100644
index 0000000..a011751
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/f2/ec8c8cf1a9fb7aa047a25a4308bfe860237ad4 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/f5/684c96bf40c709877b56404cd8a5dd2d2a7978 b/tests/resources/cherrypick/.gitted/objects/f5/684c96bf40c709877b56404cd8a5dd2d2a7978
new file mode 100644
index 0000000..83bb5a0
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/f5/684c96bf40c709877b56404cd8a5dd2d2a7978 differ
diff --git a/tests/resources/cherrypick/.gitted/objects/f9/0f9dcbdac2cce5cc166346160e19cb693ef4e8 b/tests/resources/cherrypick/.gitted/objects/f9/0f9dcbdac2cce5cc166346160e19cb693ef4e8
new file mode 100644
index 0000000..71be9f8
Binary files /dev/null and b/tests/resources/cherrypick/.gitted/objects/f9/0f9dcbdac2cce5cc166346160e19cb693ef4e8 differ
diff --git a/tests/resources/cherrypick/.gitted/refs/heads/automerge-branch b/tests/resources/cherrypick/.gitted/refs/heads/automerge-branch
new file mode 100644
index 0000000..9330ef3
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/refs/heads/automerge-branch
@@ -0,0 +1 @@
+d3d77487660ee3c0194ee01dc5eaf478782b1c7e
diff --git a/tests/resources/cherrypick/.gitted/refs/heads/master b/tests/resources/cherrypick/.gitted/refs/heads/master
new file mode 100644
index 0000000..aa8913b
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/refs/heads/master
@@ -0,0 +1 @@
+2a26c7e88b285613b302ba76712bc998863f3cbc
diff --git a/tests/resources/cherrypick/.gitted/refs/heads/merge-branch b/tests/resources/cherrypick/.gitted/refs/heads/merge-branch
new file mode 100644
index 0000000..ea5b277
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/refs/heads/merge-branch
@@ -0,0 +1 @@
+abe4603bc7cd5b8167a267e0e2418fd2348f8cff
diff --git a/tests/resources/cherrypick/.gitted/refs/heads/merge-conflicts b/tests/resources/cherrypick/.gitted/refs/heads/merge-conflicts
new file mode 100644
index 0000000..f63f17e
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/refs/heads/merge-conflicts
@@ -0,0 +1 @@
+bafbf6912c09505ac60575cd43d3f2aba3bd84d8
diff --git a/tests/resources/cherrypick/.gitted/refs/heads/merge-mainline b/tests/resources/cherrypick/.gitted/refs/heads/merge-mainline
new file mode 100644
index 0000000..0ec5e45
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/refs/heads/merge-mainline
@@ -0,0 +1 @@
+cfc4f0999a8367568e049af4f72e452d40828a15
diff --git a/tests/resources/cherrypick/.gitted/refs/heads/orphan b/tests/resources/cherrypick/.gitted/refs/heads/orphan
new file mode 100644
index 0000000..f4d6a74
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/refs/heads/orphan
@@ -0,0 +1 @@
+74f06b5bfec6d33d7264f73606b57a7c0b963819
diff --git a/tests/resources/cherrypick/.gitted/refs/heads/renames b/tests/resources/cherrypick/.gitted/refs/heads/renames
new file mode 100644
index 0000000..df55871
--- /dev/null
+++ b/tests/resources/cherrypick/.gitted/refs/heads/renames
@@ -0,0 +1 @@
+44cd2ed2052c9c68f9a439d208e9614dc2a55c70
diff --git a/tests/resources/cherrypick/file1.txt b/tests/resources/cherrypick/file1.txt
new file mode 100644
index 0000000..38c05a8
--- /dev/null
+++ b/tests/resources/cherrypick/file1.txt
@@ -0,0 +1,15 @@
+!File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
+File 1
diff --git a/tests/resources/cherrypick/file2.txt b/tests/resources/cherrypick/file2.txt
new file mode 100644
index 0000000..a661b5d
--- /dev/null
+++ b/tests/resources/cherrypick/file2.txt
@@ -0,0 +1,15 @@
+!File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
+File 2
diff --git a/tests/resources/cherrypick/file3.txt b/tests/resources/cherrypick/file3.txt
new file mode 100644
index 0000000..85a4a1d
--- /dev/null
+++ b/tests/resources/cherrypick/file3.txt
@@ -0,0 +1,15 @@
+!File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3
+File 3