diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-07-03 14:46:55 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-07-13 17:21:10 +0200 |
commit | 7f5a31d79ee255c1b6954b4138f7848805ad778f (patch) | |
tree | b5eab16d7b40453d4f697be3fdcbea5587da92fb /src/buildtool/execution_api/execution_service/operations_server.hpp | |
parent | 9a7d5ddd3e151dd06ef8c590c9ec09490a016345 (diff) | |
download | justbuild-7f5a31d79ee255c1b6954b4138f7848805ad778f.tar.gz |
just-mr: Fix handling of .gitignore files in git repositories
The command 'git add .' does not include paths found in .gitignore
files in the directory tree where the command is issued. This is
not the desired behaviour, as we expect for a tree with a given
commit id to contain all of the entries, irrespective of their
meaning to Git.
This commit addresses the issue as described.
For the just-mr.py script we modified the staging command to
'git add -f .'.
For the compiled just-mr, simply adding the force flag to
'git_index_add_all' did not work as intended for files found in
ignored subdirectories. This is a known libgit2 issue which has
been fixed in v1.6.3. Until we can upgrade our libgit2 version,
a workaround was implemented: we recursively read the directory
entries ourselves and add each of them iteratively using
'git_index_add_bypath', making sure to ignore the root '.git'
subtree (which cannot be staged).
At the moment the handling of Git submodules remains an open issue,
as Git does not allow '.git' subtrees to be forcefully added to the
index, and thus such directory entries will currently not be
considered as part of a git tree. This however is consistent
behavior between Git and libgit2.
(cherry picked from f234434a6fa2118b10765cff2f75bbc3196fec39)
Diffstat (limited to 'src/buildtool/execution_api/execution_service/operations_server.hpp')
0 files changed, 0 insertions, 0 deletions