Commit Graph

2132 Commits

Author SHA1 Message Date
Timo Röhling
f1fdcff351 New upstream version 1.6.4+ds 2023-06-19 11:01:40 +02:00
Timo Röhling
b3b16230ef New upstream version 1.5.1+ds 2023-01-22 22:01:04 +01:00
Timo Röhling
ad5611d85b New upstream version 1.5.0+ds 2022-08-28 14:13:25 +02:00
Mohammed Bilal
e579e0f707 New upstream version 1.4.3+dfsg.1 2022-05-05 10:45:21 +00:00
Pirate Praveen
c25aa7cd82 New upstream version 1.3.0+dfsg.1 2021-12-10 16:42:08 +05:30
Utkarsh Gupta
22a2d3d5ef New upstream version 1.1.0+dfsg.1 2020-12-07 04:06:37 +05:30
Utkarsh Gupta
b6832cbfa8 New upstream version 0.28.4+dfsg.1 2020-02-14 01:55:56 +05:30
Pirate Praveen
6147f643d7 New upstream version 0.28.3+dfsg.1 2019-11-15 22:07:09 +05:30
Jongmin Kim
ac3d33df5d New upstream version 0.28.1+dfsg.1 2019-05-12 00:29:21 +09:00
Raju Devidas
6c7cee4230 New upstream version 0.27.7+dfsg.1 2018-12-27 01:36:29 +05:30
Ximin Luo
4b3ec53c78 New upstream version 0.27.4+dfsg.1 2018-08-10 19:43:40 -07:00
Pirate Praveen
eae0bfdcd8 New upstream version 0.27.0+dfsg.1 2018-04-26 18:06:07 +05:30
Edward Thomson
8296da5f60 Merge pull request #4267 from mohseenrm/master
adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention
2017-06-14 10:49:28 +02:00
Mohseen Mukaddam
a78441bc46 Adding git_filter_init for initializing git_filter struct + unit test 2017-06-13 11:05:40 -07:00
Patrick Steinhardt
a180e7d95e tests: odb: add more low-level backend tests
Introduce a new test suite "odb::backend::simple", which utilizes the
fake backend to exercise the ODB abstraction layer. While such tests
already exist for the case where multiple backends are put together, no
direct testing for functionality with a single backend exist yet.
2017-06-13 11:44:09 +02:00
Patrick Steinhardt
b2e53f3692 tests: odb: implement exists_prefix for the fake backend
The fake backend currently implements all reading functions except for
the `exists_prefix` one. Implement it to enable further testing of the
ODB layer.
2017-06-13 11:43:20 +02:00
Patrick Steinhardt
983e627d10 tests: odb: use correct OID length
The `search_object` function takes the OID length as one of its
parameters, where its maximum length is `GIT_OID_HEXSZ`. The `exists`
function of the fake backend used `GIT_OID_RAWSZ` though, leading to
only the first half of the OID being used when finding the correct
object.
2017-06-13 11:41:29 +02:00
Patrick Steinhardt
c4cbb3b16e tests: odb: have the fake backend detect ambiguous prefixes
In order to be able to test the ODB prefix functions, we need to be able
to detect ambiguous prefixes in case multiple objects with the same
prefix exist in the fake ODB. Extend `search_object` to detect ambiguous
queries and have callers return its error code instead of always
returning `GIT_ENOTFOUND`.
2017-06-13 11:40:05 +02:00
Patrick Steinhardt
95170294a1 tests: core: test initialization of git_proxy_options
Initialization of the `git_proxy_options` structure is never tested
anywhere. Include it in our usual initialization test in
"core::structinit::compare".
2017-06-13 11:35:48 +02:00
Patrick Steinhardt
bee423cc26 tests: network: add missing include for git_repository_new
A newly added test uses the `git_repository_new` function without the
corresponding header file being included. While this works due to the
compiler deducing the correct function signature, we should obviously
just include the function's declaration file.
2017-06-13 11:34:49 +02:00
Edward Thomson
2ca088bd2b Merge pull request #4265 from pks-t/pks/read-prefix-tests
Read prefix tests
2017-06-12 22:47:54 +01:00
Edward Thomson
fe9a5dd3ca remote: ensure we can create an anon remote on inmemory repo
Given a wholly in-memory repository, ensure that we can create an
anonymous remote and perform actions on it.
2017-06-12 16:51:05 +01:00
Patrick Steinhardt
f148258a35 tests: odb: add tests with multiple backends
Previous to pulling out and extending the fake backend, it was quite
cumbersome to write tests for very specific scenarios regarding
backends. But as we have made it more generic, it has become much easier
to do so. As such, this commit adds multiple tests for scenarios with
multiple backends for the ODB.

The changes also include a test for a very targeted scenario. When one
backend found a matching object via `read_prefix`, but the last backend
returns `GIT_ENOTFOUND` and when object hash verification is turned off,
we fail to reset the error code to `GIT_OK`. This causes us to segfault
later on, when doing a double-free on the returned object.
2017-06-12 17:24:53 +02:00
Patrick Steinhardt
6e010bb126 tests: odb: allow passing fake objects to the fake backend
Right now, the fake backend is quite restrained in the way how it
works: we pass it an OID which it is to return later as well as an error
code we want it to return. While this is sufficient for existing tests,
we can make the fake backend a little bit more generic in order to allow
us testing for additional scenarios.

To do so, we change the backend to not accept an error code and OID
which it is to return for queries, but instead a simple array of OIDs
with their respective blob contents. On each query, the fake backend
simply iterates through this array and returns the first matching
object.
2017-06-12 17:24:53 +02:00
Patrick Steinhardt
369cb45fc3 tests: do not reuse OID from backend
In order to make the fake backend more useful, we want to enable it
holding multiple object references. To do so, we need to decouple it
from the single fake OID it currently holds, which we simply move up
into the calling tests.
2017-06-12 17:24:53 +02:00
Patrick Steinhardt
2add34d0fb tests: odb: move fake backend into its own file
The fake backend used by the test suite `odb::backend::nonrefreshing` is
useful to have some low-level tests for the ODB layer. As such, we move
the implementation into its own `backend_helpers` module.
2017-06-12 17:24:53 +02:00
Edward Thomson
6f960b553b Merge pull request #4088 from chescock/packfile-name-using-complete-hash
Ensure packfiles with different contents have different names
2017-06-11 10:37:46 +01:00
Edward Thomson
d2c4f7645c Merge pull request #4260 from libgit2/ethomson/forced_checkout_2
Update to forced checkout and untracked files
2017-06-11 09:54:04 +01:00
Patrick Steinhardt
0ef405b3c8 checkout: do not delete directories with untracked entries
If the `GIT_CHECKOUT_FORCE` flag is given to any of the `git_checkout`
invocations, we remove files which were previously staged. But while
doing so, we unfortunately also remove unstaged files in a directory
which contains at least one staged file, resulting in potential data
loss.

This commit adds two tests to verify behavior.
2017-06-10 19:16:08 +01:00
Patrick Steinhardt
6c23704df5 settings: rename GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION
Initially, the setting has been solely used to enable the use of
`fsync()` when creating objects. Since then, the use has been extended
to also cover references and index files. As the option is not yet part
of any release, we can still correct this by renaming the option to
something more sensible, indicating not only correlation to objects.

This commit renames the option to `GIT_OPT_ENABLE_FSYNC_GITDIR`. We also
move the variable from the object to repository source code.
2017-06-08 21:40:18 +02:00
Patrick Steinhardt
92d3ea4e39 tests: index::version: improve write test for index v4
The current write test does not trigger some edge-cases in the index
version 4 path compression code. Rewrite the test to start off the an
empty standard repository, creating index entries with interesting paths
itself. This allows for more fine-grained control over checked paths.
Furthermore, we now also verify that entry paths are actually
reconstructed correctly.
2017-06-06 09:38:44 +02:00
Patrick Steinhardt
8fe335382a tests: index::version: verify we write compressed index entries
While we do have a test which checks whether a written index of version
4 has the correct version set, we do not check whether this actually
enables path compression for index entries. This commit adds a new test
by adding a number of index entries with equal path prefixes to the
index and subsequently flushing that to disk. With suffix compression
enabled by index version 4, only the last few bytes of these paths will
actually have to be written to the index, saving a lot of disk space.
For the test, differences are about an order of magnitude, allowing us
to easily verify without taking a deeper look at actual on-disk
contents.
2017-06-06 09:38:44 +02:00
Patrick Steinhardt
82368b1bad tests: index::version: add test to read index version v4
While we have a simple test to determine whether we can write an index
of version 4, we never verified that we are able to read this kind of
index (and in fact, we were not able to do so). Add a new repository
which has an index of version 4. This repository is then read from a new
test.
2017-06-06 09:38:44 +02:00
Patrick Steinhardt
fea0c81e95 tests: index::version: move up cleanup function
The init and cleanup functions for test suites are usually prepended to
our actual tests. The index::version test suite does not adhere to this
stile. Fix this.
2017-06-06 09:38:44 +02:00
Patrick Steinhardt
8a5e7aaecf varint: fix computation for remaining buffer space
When encoding varints to a buffer, we want to remain sure that the
required buffer space does not exceed what is actually available. Our
current check does not do the right thing, though, in that it does not
honor that our `pos` variable counts the position down instead of up. As
such, we will require too much memory for small varints and not enough
memory for big varints.

Fix the issue by correctly calculating the required size as
`(sizeof(varint) - pos)`. Add a test which failed before.
2017-06-06 09:33:53 +02:00
Edward Thomson
dd0aa811dd Merge branch 'pr/4228' 2017-06-04 22:46:07 +01:00
Edward Thomson
82e929a88b Merge pull request #4239 from roblg/toplevel-dir-ignore-fix
Fix issue with directory glob ignore in subdirectories
2017-06-04 19:35:39 +02:00
Edward Thomson
04de614b1f Merge pull request #4243 from pks-t/pks/submodule-workdir
Submodule working directory
2017-06-04 19:03:07 +02:00
Carlos Martín Nieto
a1023a4302 Merge pull request #4179 from libgit2/ethomson/expand_tilde
Introduce home directory expansion function for config files, attribute files
2017-05-20 17:18:07 +02:00
Carlos Martín Nieto
e694e4e954 Merge pull request #4174 from libgit2/ethomson/set_head_to_tag
git_repository_set_head: use tag name in reflog
2017-05-20 14:17:36 +02:00
Carlos Martín Nieto
119bdd8658 Merge pull request #4231 from wabain/open-revrange
revparse: support open-ended ranges
2017-05-20 14:13:27 +02:00
Chris Hescock
c0e5415566 indexer: name pack files after trailer hash
Upstream git.git has changed the way how packfiles are named.
Previously, they were using a hash of the contained object's OIDs, which
has then been changed to use the hash of the complete packfile instead.
See 1190a1acf (pack-objects: name pack files after trailer hash,
2013-12-05) in the git.git repository for more information on this
change.

This commit changes our logic to match the behavior of core git.
2017-05-19 10:10:54 -04:00
Patrick Steinhardt
2696c5c3ec repository: make check if repo is a worktree more strict
To determine if a repository is a worktree or not, we currently check
for the existence of a "gitdir" file inside of the repository's gitdir.
While this is sufficient for non-broken repositories, we have at least
one case of a subtly broken repository where there exists a gitdir file
inside of a gitmodule. This will cause us to misidentify the submodule
as a worktree.

While this is not really a fault of ours, we can do better here by
observing that a repository can only ever be a worktree iff its common
directory and dotgit directory are different. This allows us to make our
check whether a repo is a worktree or not more strict by doing a simple
string comparison of these two directories. This will also allow us to
do the right thing in the above case of a broken repository, as for
submodules these directories will be the same. At the same time, this
allows us to skip the `stat` check for the "gitdir" file for most
repositories.
2017-05-19 09:44:44 +02:00
Robert Gay
c3b8e8b358 Fix issue with directory glob ignore in subdirectories 2017-05-17 08:24:11 -07:00
Patrick Steinhardt
e526fbc703 tests: add test suite for opening submodules 2017-05-17 09:41:48 +02:00
Patrick Steinhardt
98a5f081c5 tests: threads::basic: remove unused function exit_abruptly 2017-05-15 07:34:04 +02:00
Patrick Steinhardt
7d7f6d332c tests: clone::local: compile UNC functions for Windows only 2017-05-15 07:34:04 +02:00
William Bain
8b107dc5e1 revparse: support open-ended ranges
Support '..' and '...' ranges where one side is not specified.
The unspecified side defaults to HEAD.

Closes #4223
2017-05-05 09:46:56 -06:00
Patrick Steinhardt
883eeb5f90 worktree: switch over worktree pruning to an opts structure
The current signature of `git_worktree_prune` accepts a flags field to
alter its behavior. This is not as flexible as we'd like it to be when
we want to enable passing additional options in the future. As the
function has not been part of any release yet, we are still free to
alter its current signature. This commit does so by using our usual
pattern of an options structure, which is easily extendable without
breaking the API.
2017-05-05 15:39:25 +02:00
Patrick Steinhardt
8264a30f4f worktree: support creating locked worktrees
When creating a new worktree, we do have a potential race with us
creating the worktree and another process trying to delete the same
worktree as it is being created. As such, the upstream git project has
introduced a flag `git worktree add --locked`, which will cause the
newly created worktree to be locked immediately after its creation. This
mitigates the race condition.

We want to be able to mirror the same behavior. As such, a new flag
`locked` is added to the options structure of `git_worktree_add` which
allows the user to enable this behavior.
2017-05-05 15:39:25 +02:00