3425 Commits

Author SHA1 Message Date
Edward Thomson
309befe413 index: test git_index_add_all with force
Ensure that when all files beneath a directory are ignored that we
add the files when FORCE is specified.
2023-03-02 23:21:50 +00:00
Edward Thomson
6fb5ab3723 index: test git_index_add_all with ignored folder
Ensure that when all files beneath a directory are ignored that we
actually ignore the files.
2023-03-02 23:09:36 +00:00
Edward Thomson
af12fc11c5 Merge pull request #6520 from libgit2/ethomson/git_odb_open
odb: restore `git_odb_open`
2023-03-02 01:31:57 -08:00
Edward Thomson
7445d510be Merge pull request #6513 from libgit2/ethomson/util_test_root
fs_path: let root run the ownership tests
2023-03-01 16:19:56 -08:00
Edward Thomson
e1e0d77c6f odb: restore git_odb_open
`git_odb_open` was erroneously removed during a refactoring; add it
back.
2023-03-01 22:16:31 +00:00
Edward Thomson
a7561e0eda Merge pull request #6512 from libgit2/ethomson/odb_loose 2023-02-27 14:23:35 -08:00
Edward Thomson
59bb933c17 odb: test git_odb_backend_loose 2023-02-27 21:54:59 +00:00
Edward Thomson
5c1d764910 fs_path: let root run the ownership tests
The `git_fs_path_owner_is_current_user` expects the root dir on unix
(`/`) to be owned by a non-current user. This makes sense unless root
(or euid == 0) is running the tests, which often happens during distro
build / packaging scripts. Allow them to run the tests.
2023-02-27 21:52:33 +00:00
Edward Thomson
c28ebdf256 Revert "tests: validate host and port for ssh tests when non-standard"
This reverts commit 43e84e246c.
2023-02-27 20:38:02 +00:00
Edward Thomson
43e84e246c tests: validate host and port for ssh tests when non-standard 2023-02-24 21:11:58 +00:00
Edward Thomson
80016e0e96 tests: always unset HTTP_PROXY before starting tests
The remote::httpproxy::env test (correctly) reset the environment before
running; however the other tests are also impacted by the environment
and need to have it isolated.
2023-02-23 10:19:19 +00:00
Miguel Arroz
c1b024fb4d #6491: Sets oid_type on repos open with git_repository_open_bare 2023-02-17 11:06:48 -08:00
Edward Thomson
05ba3fe4e1 Merge pull request #6330 from gitkraken-jacobw/partial-stashing
stash: partial stash specific files
2023-02-16 10:23:28 +00:00
Edward Thomson
b8fff35ab3 tests: use static scope for test data 2023-02-15 10:08:42 +00:00
Edward Thomson
80742e159c Merge pull request #6456 from libgit2/ethomson/sha256_experimental
SHA256: more SHA256 support
2023-02-14 17:01:23 +00:00
Edward Thomson
f7963f28ca Merge pull request #6455 from libgit2/ethomson/sysdir
Support the notion of a home directory separately from global configuration directory
2023-02-14 16:36:19 +00:00
Edward Thomson
0362ecd6f1 Merge pull request #6423 from cavaquinho/fix/6422-revwalk_push_glob-dangling-ref
#6422: handle dangling symbolic refs gracefully
2023-02-14 15:23:11 +00:00
Edward Thomson
3b43c9d335 Merge branch 'revparse' 2023-02-14 12:01:04 +00:00
Sven Strickroth
0628e25d04 Fix parsing rev with reflog of HEAD (e.g., HEAD@{3})
Fixes issue #6156.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2023-02-14 11:52:28 +00:00
Iliyas Jorio
b755b7d294 diff_file: don't mmap/readbuffer empty files
This prevents GIT_MMAP_VALIDATE from failing.
This also prevents git_diff_file_content__unload from attempting to free git_str__initstr.
2023-02-13 21:31:47 +01:00
Edward Thomson
e7a7691146 win32: adjust max path length for SHA256
The longest path within a git repository is now a SHA256 format
packfile. Adjust our max length checking to match.
2023-02-13 10:27:13 +00:00
Edward Thomson
0006ff6335 clone: support sha256 2023-02-12 22:02:00 +00:00
Edward Thomson
fe2ee3a018 object: lookup sha256 objects
This is much of the plumbing for the object database to support SHA256,
and for objects to be able to parse SHA256 versions of themselves.
2023-02-12 22:02:00 +00:00
Edward Thomson
6204499242 odb: test sha256 pack backend 2023-02-12 21:26:12 +00:00
Edward Thomson
479c8c8c14 packfile: handle sha256 packfiles
Teach the packfile machinery to cope with SHA256.
2023-02-12 21:26:12 +00:00
Edward Thomson
e89e2e0102 odb: rename test file to avoid underscore
In clar, an underscore is meaningful; avoid using it incorrectly /
unnecessarily.
2023-02-12 21:26:11 +00:00
Edward Thomson
23df884ea7 tests: add a sha256 repository
This is a conversion of the testrepo.git to SHA256 support.
2023-02-12 21:26:11 +00:00
Edward Thomson
f6dbf9c594 tests: helpers for getting ints from configuration 2023-02-12 21:26:11 +00:00
Edward Thomson
366973f378 repo: don't overwrite repo format version on reinit
Ensure that we maintain the `core.repositoryFormatVersion` value instead
of always overwriting it with the default.
2023-02-12 21:26:11 +00:00
Edward Thomson
acb00e4eae repo: understand the objectformat extension
Teach the repository about the `objectformat` extension, supporting
`sha1` always and `sha256` when the experimental sha256 support is
active.
2023-02-12 21:26:10 +00:00
Edward Thomson
4083e46f47 oid: provide type lookups by enum value or name 2023-02-09 12:31:16 +00:00
Edward Thomson
9b546b2ba1 ci: run clone tests in online 2023-02-09 12:10:40 +00:00
Edward Thomson
247474fdbd tests: known_hosts manipulating ssh clone tests
Teach the clone tests how to clone from github.com, when given a keypair
with a passphrase and known_hosts data. This allows us to better
exercise our known_hosts checking and ensure that the lifecycle of the
certificate callback matches our expectations.
2023-02-09 12:10:40 +00:00
Edward Thomson
ff67b5e117 tests: use a dummy homedir
Use a dummy home directory for tests to avoid user data leaking into
test execution.
2023-02-09 12:10:40 +00:00
Edward Thomson
f32ec999b0 tests: configure temporary homedirs correctly
Now that we've split the notion of the home directory from the global
configuration store, our tests should use the appropriate one based on
what they're doing.
2023-02-09 12:10:40 +00:00
Edward Thomson
9a9863645d sysdir: move windows sysdir functions out of shared util
The windows sysdir functions are libgit2-specific and for git
compatibility only; remove them from the shared util directory and bring
them into the libgit2 source tree.
2023-02-09 12:10:40 +00:00
Edward Thomson
ed26a908fe clar: cross-platform elapsed time counter
Abstract time counter for tests; use gettimeofday on Unix and
GetTickCount on Windows.
2023-01-25 09:37:22 +00:00
Edward Thomson
4e15c9c87f tests: fix clar declarations 2023-01-25 09:36:48 +00:00
Edward Thomson
6bf0459a42 tests: update clar test runner
Update to the latest main version of clar, which includes improved xml
summary output.
2023-01-25 09:36:07 +00:00
Edward Thomson
2347eb3263 Merge pull request #6362 from sven-of-cord/main
push: revparse refspec source, so you can push things that are not refs
2023-01-20 22:33:36 +00:00
Edward Thomson
3ee86a3329 Merge commit 'e33d7c068' into ssh_key_checking 2023-01-20 22:13:14 +00:00
tagesuhu
b57b7628d4 tests: Add new test to submodule::update
Verify that trying to update submodule which has been configured but not added does return an error.

Issue #6433: git_submodule_update fails to update configured but missing submodule
2022-11-25 16:32:39 +00:00
Edward Thomson
12832bab73 Merge pull request #6326 from libgit2/ethomson/url_parse
URL parsing for google-compatible URLs
2022-11-23 13:57:07 +00:00
Sven Strickroth
594bd70b84 Add support for "safe.directory *"
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2022-11-19 12:00:43 +01:00
Edward Thomson
ad2d3a0696 Merge pull request #6408 from kcsaul/fix-safe-directory-not-found
Ignore missing 'safe.directory' config during ownership checks
2022-11-18 13:54:49 +00:00
Carlos Martín Nieto
a218f1bf74 tests: move online::clone::ssh_auth_methods into the ssh test suite
We're currently running it as part of the online suite but that doesn't have any
setup for ssh so we won't find the GitHub keys we set up during the test.

It doesn't need the private key setup as we just want to make sure we see some
auth request from the server, but with the addition of hostkey checking we're
now seeing it fail when we skip these tests.
2022-11-04 10:33:55 +01:00
Miguel Arroz
b57221e829 #6422: handle dangling symbolic refs gracefully 2022-11-03 11:26:30 -07:00
Colin Stolley
2c4eb83ee1 commit-graph: only verify csum on git_commit_graph_open().
It is expensive to compute the sha1 of the entire commit-graph file each
time we open it. Git only does this if it is re-writing the file.

This patch will only verify the checksum when calling the external API
git_commit_graph_open(), which explicitly says it opens and verifies
the commit graph in the documentation.

For internal library calls, we call git_commit_graph_get_file(), which
mmaps the commit-graph file in read-only mode. Therefore it is safe to
skip the validation check there.

Tests were added to check that the validation works in the happy path,
and prevents us from opening the file when validation fails.

(Note from Derrick Stolee: This patch was applied internally at GitHub
after we recognized the performance impact it had during an upgrade of
libgit2. The original author left the company before we remembered to
send it upstream.)

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
2022-11-03 12:09:18 -04:00
Kevin Saul
dd21e20ce2 repo: test ownership validation fails with expected error 2022-10-01 16:36:38 +13:00
Edward Thomson
9286e5991e Merge pull request #6405 from libgit2/ethomson/experimental
Support non-cmake builds with an in-tree `experimental.h`
2022-09-21 15:19:30 +01:00