auto repo = initRepo(_userRepo, OpenBare.yes); scope(exit) rmdirRecurse(_userRepo); string[] mergeHeadItems = [ "e496660174425e3147a0593ced2954f3ddbf65ca\n", "e496660174425e3147a0593ced2954f3ddbf65ca\n" ]; std.file.write(buildPath(repo.path, "MERGE_HEAD"), mergeHeadItems.join()); auto buffer = repo.getMergeHeadItems(appender!(MergeHeadItem[])); foreach (string line, MergeHeadItem item; lockstep(mergeHeadItems, buffer.data)) { string commitHex = line.split[0]; assert(item.oid == GitOid(commitHex)); }
Read each item in the MERGE_HEAD file to the output range sink, and return the sink.