1 auto repo = initRepo(_userRepo, OpenBare.yes); 2 scope(exit) rmdirRecurse(_userRepo); 3 4 string[] mergeHeadItems = [ 5 "e496660174425e3147a0593ced2954f3ddbf65ca\n", 6 "e496660174425e3147a0593ced2954f3ddbf65ca\n" 7 ]; 8 9 std.file.write(buildPath(repo.path, "MERGE_HEAD"), mergeHeadItems.join()); 10 11 auto buffer = repo.getMergeHeadItems(appender!(MergeHeadItem[])); 12 13 foreach (string line, MergeHeadItem item; lockstep(mergeHeadItems, buffer.data)) 14 { 15 string commitHex = line.split[0]; 16 assert(item.oid == GitOid(commitHex)); 17 }
Read each item in the MERGE_HEAD file to the output range sink, and return the sink.