1 auto repo = initRepo(_userRepo, OpenBare.yes); 2 scope(exit) rmdirRecurse(_userRepo); 3 4 string[] fetchHeadItems = [ 5 "23c3c6add8162693f85b3b41c9bf6550a71a57d3 branch 'master' of git://github.com/D-Programming-Language/dmd\n", 6 "aaf64112624abab1f6cc8f610223f6e12b525e09 branch 'master' of git://github.com/D-Programming-Language/dmd\n" 7 ]; 8 9 std.file.write(buildPath(repo.path, "FETCH_HEAD"), fetchHeadItems.join()); 10 11 auto buffer = repo.getFetchHeadItems(appender!(FetchHeadItem[])); 12 13 foreach (string line, FetchHeadItem item; lockstep(fetchHeadItems, buffer.data)) 14 { 15 string commitHex = line.split[0]; 16 17 assert(item.refName == "refs/heads/master"); 18 assert(item.remoteURL == "git://github.com/D-Programming-Language/dmd"); 19 assert(item.oid == GitOid(commitHex)); 20 }
Read each item in the FETCH_HEAD file to the output range sink, and return the sink.