summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system
AgeCommit message (Collapse)Author
2025-01-13GitCAS: remove friend GitRepoMaksim Denisov
...and access internal state via getters. (cherry-picked from ca952159e778f0ed927082832a195842f6229a94)
2025-01-13GitCAS: remove mutex and locksMaksim Denisov
...since there are no unique_locks any more. (cherry-picked from 9a164558010af84d834dee86f1929bd6582a1ccb)
2025-01-13GitRepo: don't reassign git_repository to git_odbMaksim Denisov
...and remove GuardedRepo. (cherry-picked from d9f39250d302152d19a0aacd76eabae7a013f1a8)
2025-01-13GitCAS: retain git_repository alive.Maksim Denisov
(cherry-picked from 7b50ad08180edb160d023ed61518cd9256f65f70)
2025-01-13GitCAS: implement method for creation of an empty GitCASMaksim Denisov
...and use it in GitRepo to set custom backends. (cherry-picked 99860b78304817c4d5b27ec4c661b733e30a430a)
2025-01-13GitCAS: remove redundant methodMaksim Denisov
(cherry-picked from f40780393d68e2ebb866d8b941b5a30f0ea5f0de)
2025-01-13GitCAS: avoid manual memory managementMaksim Denisov
...and fix a potential memory leak in the try-catch for std::filesystem::absolute. (cherry-picked from 44ec2679c68cbe6141b76d9758b5986725a62d91)
2025-01-13GitCAS: use the same call for openning repository as GitRepo does.Maksim Denisov
(cherry-picked from cdd3a6a777a36ff98b60cf47c91281a69c39c4e2)
2025-01-13GitRepo: keep GuardedRepo unexposed and adjust the interface.Maksim Denisov
(cherry-picked from d9f39250d302152d19a0aacd76eabae7a013f1a8)
2024-12-03Avoid double deletion of git_repository in GuardedRepoMaksim Denisov
(cherry-picked from 59a485598d1a57b78fb60fe7df7dfe08a1cadd83)
2024-12-03Synchronize initialization of a git repo across processesMaksim Denisov
2024-12-03Ensure gitstrarray gets created with alive pointers.Maksim Denisov
(cherry-picked from 9dc61e9faca5e8b05a1a2a2eed83a5468aeb6202)
2024-10-29Clean up unused dependenciesKlaus Aehlig
2024-10-10Remove from OSS intersecting public-private dependenciesMaksim Denisov
2024-10-08Name local variables using lower_caseMaksim Denisov
...and private members using lower_case_
2024-10-08Name global constants using kCamelCase.Maksim Denisov
2024-10-08Name static constants using kCamelCase.Maksim Denisov
2024-10-08Name classes, structs and enums using CamelCase.Maksim Denisov
2024-10-07Enable cppcoreguidelines-* checks.Maksim Denisov
2024-10-07Disable misc-no-recursion checkMaksim Denisov
...since we use recursion for trees a lot, but skip this check manually.
2024-10-07Enable readability-* checks.Maksim Denisov
2024-10-07Enable readability-redundant-member-init check.Maksim Denisov
2024-10-07Enable bugprone-empty-catch check.Maksim Denisov
2024-10-07Enable bugprone-implicit-widening-of-multiplication-result check.Maksim Denisov
2024-10-07Enable bugprone-narrowing-conversions checkMaksim Denisov
2024-10-07Replace manual new allocations for git_strarray with std::vectorsMaksim Denisov
...and remove unused code from git_utils
2024-09-26Fix enum sizes proposed by clang-tidy.Maksim Denisov
Enable performance-enum-size check.
2024-09-26Fix redundant std::optional conversionsMaksim Denisov
...proposed by clang-tidy. Enable bugprone-optional-value-conversion check.
2024-09-26Fix assignments in conditionsMaksim Denisov
...proposed by clang-tidy. Enable bugprone-assignment-in-if-condition check.
2024-09-23Reorder dependencies and remove duplicates in OSSMaksim Denisov
2024-09-23Store HashFunction by const reference.Maksim Denisov
Despite the fact that HashFunction is a small type, it still makes sense to store it by reference to reflect the ownership. StorageConfig becomes the main holder. Reference holders store HashFunction by const ref and aren't allowed to change it. However, they are free to return HashFunction by value since this doesn't benefit readability anyhow.
2024-09-13Pass HashFunction::Type to FileRoot::AsKnownTreeMaksim Denisov
...to get the protocol type.
2024-09-13Pass HashFunction::Type to SourceTargetMapMaksim Denisov
...that is to be used by FileRoot::ToArtifactDescription.
2024-09-13Rename Compatibility class to ProtocolTraitsMaksim Denisov
...and move it to the common stage.
2024-09-13Move to GitHashesConverter functionality related to conversion of git hashesMaksim Denisov
...from Compatibility.
2024-09-12Remove unused variablesKlaus Aehlig
2024-09-11Use ArtifactDigestFactory in file_rootMaksim Denisov
...to create ArtifactDigests.
2024-09-11Use ArtifactDigestFactory in GitRepoMaksim Denisov
...to create ArtifactDigests.
2024-09-09Replace ArtifactDigest::CreateMaksim Denisov
...with ArtifactDigestFactory::HashDataAs
2024-09-09Replace ArtifactDigest::CreateFromFileMaksim Denisov
...with ArtifactDigestFactory::HashFileAs
2024-08-30Replace bazel_re::Digest in ObjectCASMaksim Denisov
...with ArtifactDigest.
2024-08-30Replace bazel_re::Digest in GitRepo::SymlinksCheckFunc callbackMaksim Denisov
...with ArtifactDigest.
2024-08-30Unify symlink checks in git treeMaksim Denisov
2024-08-29FileSystemManager: Implicit copy should not follow symlinksPaul Cristian Sarbu
The default options of std::filesystem::copy include following symlinks, resulting in file repositories creating wrong trees if containing unresolved symlinks, or failing unexpectedly early if symlink cycles existed. This is fixed by ensuring the copy_symlinks option is always used.
2024-08-27Reformat code to comply with clang-format 18Klaus Aehlig
... while keeping our .clang-format file.
2024-08-26GitRepo: Create commit from a directory explicitly...Paul Cristian Sarbu
...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.
2024-08-26GitRepo: Add method to create tree from directoryPaul Cristian Sarbu
The tree is traversed bottom-up and each entry is explicitly added to the object database: non-directory entries have their content read and are added as blobs with corresponding permissions based on file type (regular, executable, symlink), while subdirectories are added as trees via CreateTree based on the already added blobs.
2024-08-26GitRepo: Change logic that creates commits to explicitly give directoryPaul Cristian Sarbu
In preparation for subsequent changes, specify the directory path containing the tree content to be committed explicitly. This change will allow eventually to be able to specify paths that are different from the root path of the repository in which the commit is created. This commit renames and refactors StageAndCommitAllAnnonymous to allow a directory path to be passed. The just-mr and serve service logic is updated such that current behaviour is otherwise unchanged.
2024-08-26GitRepo: Create trees by directly writing to object databasePaul Cristian Sarbu
The libgit2 treebuilder has unnecessary validity checks for tree entries, including for Git-specific magic names (such as '.git'), which cannot be disabled. However, in our tool any filesystem entry should be allowed to be part of a tree. Therefore, the treebuilder-based implementation for CreateTree is replaced by a direct writing of trees, by content, into the underlying repository object database. Additionally, as direct insertion into the object dabase does not check the validity of the tree entries, as was done implicitly by the treebuilder before, add a check for existence of the tree entries into the debug-level generic validity check, with the option to not perform it for ReadTree (as it is unnecessary there).
2024-08-26GitRepo: Update to use specific getter for repository root pathPaul Cristian Sarbu