summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_repo.hpp
AgeCommit message (Collapse)Author
2025-06-04GitRepo: Add tree reader without symlink checkerPaul Cristian Sarbu
2025-01-15Add to GitRepo common implementation IsTreeInRepoMaksim Denisov
2025-01-15Add to GitRepo common implementation of ImportToGitMaksim Denisov
2024-12-05GitCAS: remove friend GitRepoMaksim Denisov
...and access internal state via getters.
2024-12-05GitRepo: don't reassign git_repository to git_odbMaksim Denisov
...and remove GuardedRepo.
2024-12-05GitRepo: keep GuardedRepo unexposed and adjust the interface.Maksim Denisov
2024-11-28Ensure gitstrarray gets created with alive pointers.Maksim Denisov
2024-11-14file_system: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-08Name classes, structs and enums using CamelCase.Maksim Denisov
2024-10-07Enable readability-redundant-member-init check.Maksim Denisov
2024-10-07Replace manual new allocations for git_strarray with std::vectorsMaksim Denisov
...and remove unused code from git_utils
2024-08-30Replace bazel_re::Digest in GitRepo::SymlinksCheckFunc callbackMaksim Denisov
...with ArtifactDigest.
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-07Pass SymlinksCheckFunc to GitRepo as not_nullMaksim Denisov
+ invoke it only if there are symlinks to check + remove the corresponding runtime check since it is replaced by a compile-time check
2024-07-19git_repo: return keep tags on successKlaus Aehlig
... instead of the plain boolean value.
2024-07-05Pass StorageConfig to git_repo and git_repo_remoteMaksim Denisov
2024-06-28Use (un)expected for Git repoOliver Reiche
2024-04-10GitRepo: Add method to keep tree alive by taggingPaul Cristian Sarbu
Also adds an appropriate test for this method.
2024-04-10git_repo: Add blob writer methodPaul Cristian Sarbu
Also extends the tests accordingly.
2024-03-26Add missing system includesPaul Cristian Sarbu
Main culprits: - std::size_t, std::nullptr_t, and NULL require <cstddef> - std::move and std::forward require <utility> - unordered maps and sets require respective includes - std::for_each and std::all_of require <algorithm>
2024-03-08just-mr: Fix shell out executionOliver Reiche
... by avoiding reusing temp dirs for execute. While we are at it, also refactor LocalFetchViaTmpRepo() to create its own empty temp dirs, that cannot be reused by the caller.
2024-01-31serve source tree: Increase server-side granularity in response statusesPaul Cristian Sarbu
For archives and Git repositories we should ensure that not finding the witnessing entity (archive content blob or Git commit, respectively) results in a distinct status in the response to a request that sets up roots on the serve endpoint. This will allow just-mr to better handle its interaction with the serve endpoint.
2024-01-08GitRepo: Add blob lookup methodPaul Cristian Sarbu
2023-11-02GitRepo: Add method for async fetch from local repositoryPaul Cristian Sarbu
This avoids using the more geenric GitRepoRemote method which has libcurl as a dependency, something that is not needed for this Git operation.
2023-11-02GitRepo: Add blob existence checkerPaul Cristian Sarbu
Also fixes a small typo in tree existence checker log messages.
2023-08-07GitRepo: Add method for reading object from tree by its pathPaul Cristian Sarbu
2023-06-26ReadTree: Add check for non-upwards symlinks...Paul Cristian Sarbu
...as early as possible. This ensures that callers always receive only the tree entries for the supported object types. For the symlinks non-upwardness check we pass a lambda capturing the real backend of the tree entries, such that the symlinks can be read. Updates git_tree tests accordingly.
2023-05-31FileRoot: Add ignore-special roots logicPaul Cristian Sarbu
2023-03-30GitRepo: Guard fake repository odb wrappingPaul Cristian Sarbu
In the current libgit2 implementation, a fake repository wrapped around an existing odb is being registered as owner the same way as a normal repository object. Therefore, one has to guard both the creation and destruction of the fake repository against all other git operations that might access the internal cache during this transfer of ownership.
2023-03-08GitRepo: Add method to check existence of a Git treePaul Cristian Sarbu
2023-02-17structure cleanup: move remote operations of GitRepo to other_tools...Paul Cristian Sarbu
...in order to not include unwanted dependencies in just proper. The new class extends the GitRepo class used for just's Git tree operations and gets used in all of just-mr's async maps.
2023-01-24Just-MR: Remove obsolete GET_BRANCH_REFNAME critical Git operationPaul Cristian Sarbu
As now all remote Git operations in GitRepo require at most just the branch name, there is no more need to inquire the repository about branch refspecs.
2023-01-24GitRepo: Remove refspec argument in retrieving commit from remote...Paul Cristian Sarbu
...and use instead the branch name. A valid direct refspec (as those retrieved by a remote_ls call) will always end in the branch name, so checking the last path component ('/'-delimited substring) of a retrieved refspec is enough.
2023-01-24GitRepo: Change FetchFromRemote to fetch based on branch namePaul Cristian Sarbu
This also removes the need to call the GET_BRANCH_REFNAME critical operation.
2023-01-19Minor fixes for compiling with clang-14Oliver Reiche
2022-12-21Git: Wrap libgit2 raw pointersPaul Cristian Sarbu
2022-12-21Just-MR: Add non-critical git ops logic to git repo classPaul Cristian Sarbu
2022-12-21Just-MR: Add critical ops logic to git repo classPaul Cristian Sarbu
2022-12-21Git CAS: Move Git tree ops to fake repo wrapper classPaul Cristian Sarbu
2022-12-20Git CAS: Add fake repository wrapper for git odbPaul Cristian Sarbu