diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-20 17:46:20 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-26 12:12:02 +0200 |
commit | 9e93d20d40ee1501b23c42b945dbf7e10420ac43 (patch) | |
tree | d85fb3eb3fc21158f4590749d47e640a04b9b451 /src/buildtool/file_system/git_repo.hpp | |
parent | 959523b077acdbd75adc4c6328e45c43cda3087c (diff) | |
download | justbuild-9e93d20d40ee1501b23c42b945dbf7e10420ac43.tar.gz |
GitRepo: Create commit from a directory explicitly...
...by writing its tree directly in the object database instead of
working with the index. This allows the creation of trees that
contain also entries with 'magic' names, such as the .git folder
or .gitignore files.
Callers must ensure the given directory only contains the needed
entries. In particular, just-mr maps and serve service are updated
to separate the import-to-Git repository path from the temporary
path containing the content to be committed, to avoid polluting the
content path with entries generated on repository initialization.
Diffstat (limited to 'src/buildtool/file_system/git_repo.hpp')
-rw-r--r-- | src/buildtool/file_system/git_repo.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buildtool/file_system/git_repo.hpp b/src/buildtool/file_system/git_repo.hpp index 2aabf7ee..4d1be53f 100644 --- a/src/buildtool/file_system/git_repo.hpp +++ b/src/buildtool/file_system/git_repo.hpp @@ -152,8 +152,9 @@ class GitRepo { using anon_logger_ptr = std::shared_ptr<anon_logger_t>; /// \brief Create tree from entries at given directory and commit it with - /// given message. Currently, the caller must guarantee that given path is - /// a subdirectory of the repository root path. + /// given message. The given path need not be a subdirectory of the + /// repository root path, but the caller must guarantee its entries are + /// readable. /// Only possible with real repository and thus non-thread-safe. /// \returns The commit hash, or nullopt if failure. It guarantees the /// logger is called exactly once with fatal if failure. |