diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-20 11:08:15 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-25 09:38:19 +0300 |
commit | 88445f77ab854bfd278fe1bcebaed2d0d131ea96 (patch) | |
tree | 1b64f4be53083d57d2bc53956081141b4cf263fb | |
parent | 7d7e102faa669539e27d69f1297b2fd491a777fb (diff) |
tests: Detect cases when Git picks up gitconfig files
We're in the process of making Gitaly gitconfig-clean: if it is told to
ignore gitconfig files, neither Git nor libgit2 should ever read any
gitconfig file except for the repository-scoped gitconfig.
Add known-broken gitconfigs to our intercepted home directory. Both Git
and libgit2 will fail to parse these files and thus return an error,
which means that we can easily detect if the gitconfig is read by
accident via our testing infrastructure.
-rw-r--r-- | internal/testhelper/testdata/home/.config/git/config | 5 | ||||
-rw-r--r-- | internal/testhelper/testdata/home/.gitconfig | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/internal/testhelper/testdata/home/.config/git/config b/internal/testhelper/testdata/home/.config/git/config new file mode 100644 index 000000000..aef95e47e --- /dev/null +++ b/internal/testhelper/testdata/home/.config/git/config @@ -0,0 +1,5 @@ +# We're trying to catch any instances of libgit2 or Git that pick up the +# gitconfig even though they're told not to. If they do pick up this file +# though, then they would fail to parse it and thus return an error, which we +# can detect quite easily. +this is broken on purpose: [ diff --git a/internal/testhelper/testdata/home/.gitconfig b/internal/testhelper/testdata/home/.gitconfig new file mode 100644 index 000000000..aef95e47e --- /dev/null +++ b/internal/testhelper/testdata/home/.gitconfig @@ -0,0 +1,5 @@ +# We're trying to catch any instances of libgit2 or Git that pick up the +# gitconfig even though they're told not to. If they do pick up this file +# though, then they would fail to parse it and thus return an error, which we +# can detect quite easily. +this is broken on purpose: [ |