Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build .sdp files from lua source code? #153

Open
marek705 opened this issue Oct 4, 2024 · 1 comment
Open

How to build .sdp files from lua source code? #153

marek705 opened this issue Oct 4, 2024 · 1 comment

Comments

@marek705
Copy link

marek705 commented Oct 4, 2024

I could not find anywhere how to make .sdp files from lua source code before uploading.

@gajop
Copy link
Member

gajop commented Oct 4, 2024

I think BuildGit.cpp does it.

Specifically this part calculates the SDP I think:

auto add = [&](git_diff_delta const * Delta, const std::string& fullPath)
{
PoolFileT File{Store};
git_blob * Blob;
checkRet(git_blob_lookup(&Blob, Repo, &Delta->new_file.id), "git_blob_lookup");
auto && BlobGuard = makeScopeGuard([&] { git_blob_free(Blob); });
auto Size = git_blob_rawsize(Blob);
auto Pointer = static_cast<char const *>(git_blob_rawcontent(Blob));
File.write(Pointer, Size);
auto FileEntry = File.close();
Archive.add(fullPath, FileEntry);
};

Also here it seems:

replaceVersion(Pointer, Size, CommitInfo.Version, [&](char const * Data, std::size_t Length)
{
File.write(Data, Length);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants