MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / appendCommit

Method appendCommit

programs/git-import/git-import.cpp:495–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493 WriteBufferFromFile line_changes{"line_changes.tsv"};
494
495 void appendCommit(const Commit & commit, const CommitDiff & files)
496 {
497 /// commits table
498 {
499 auto & out = commits;
500
501 commit.writeTextWithoutNewline(out);
502 writeChar('\n', out);
503 }
504
505 for (const auto & elem : files)
506 {
507 const FileChange & file_change = elem.second.file_change;
508
509 /// file_changes table
510 {
511 auto & out = file_changes;
512
513 file_change.writeTextWithoutNewline(out);
514 writeChar('\t', out);
515 commit.writeTextWithoutNewline(out);
516 writeChar('\n', out);
517 }
518
519 /// line_changes table
520 for (const auto & line_change : elem.second.line_changes)
521 {
522 auto & out = line_changes;
523
524 line_change.writeTextWithoutNewline(out);
525 writeChar('\t', out);
526 file_change.writeTextWithoutNewline(out);
527 writeChar('\t', out);
528 commit.writeTextWithoutNewline(out);
529 writeChar('\n', out);
530 }
531 }
532 }
533
534 void finalize()
535 {

Callers 1

processCommitFunction · 0.80

Calls 2

writeCharFunction · 0.85

Tested by

no test coverage detected