Commit Graph

1937 Commits

Author SHA1 Message Date
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
Mohseen Mukaddam
a78441bc46 Adding git_filter_init for initializing git_filter struct + unit test 2017-06-13 11:05:40 -07:00
Mohseen Mukaddam
7f7dabdaac adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention 2017-06-13 10:59:25 -07:00
Edward Thomson
9d49a43c71 repository_item_path: return ENOTFOUND when appropriate
Disambiguate error values: return `GIT_ENOTFOUND` when the item cannot
exist in the repository (perhaps because the repository is inmemory or
otherwise not backed by a filesystem), return `-1` when there is a hard
failure.
2017-06-12 16:51:04 +01:00
Edward Thomson
2a3cc403bd Update version number to v0.26 2017-06-11 12:23:34 +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
Edward Thomson
dd0aa811dd Merge branch 'pr/4228' 2017-06-04 22:46:07 +01:00
Edward Thomson
f0848dd7e0 worktree: upgrade lock to an int 2017-06-04 22:44:30 +01: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
Patrick Steinhardt
a7aa73a535 worktree: introduce git_worktree_add options
The `git_worktree_add` function currently accepts only a path and name
for the new work tree. As we may want to expand these parameters in
future versions without adding additional parameters to the function for
every option, this commit introduces our typical pattern of an options
struct. Right now, this structure is still empty, which will change with
the next commit.
2017-05-02 12:39:29 +02:00
Edward Thomson
13c1bf0718 Merge pull request #4197 from pks-t/pks/verify-object-hashes
Verify object hashes
2017-05-01 16:17:48 +01:00
Edward Thomson
d870284386 Merge pull request #4206 from libgit2/cmn/transport-get-proxy
transport: provide a getter for the proxy options
2017-05-01 16:11:56 +01:00
Edward Thomson
45071cec11 git_remote_push: document that NULL refspecs allowed 2017-05-01 15:23:27 +01:00
Patrick Steinhardt
35079f507b odb: add option to turn off hash verification
Verifying hashsums of objects we are reading from the ODB may be costly
as we have to perform an additional hashsum calculation on the object.
Especially when reading large objects, the penalty can be as high as
35%, as can be seen when executing the equivalent of `git cat-file` with
and without verification enabled. To mitigate for this, we add a global
option for libgit2 which enables the developer to turn off the
verification, e.g. when he can be reasonably sure that the objects on
disk won't be corrupted.
2017-04-28 14:05:45 +02:00
Patrick Steinhardt
28a0741f1a odb: verify object hashes
The upstream git.git project verifies objects when looking them up from
disk. This avoids scenarios where objects have somehow become corrupt on
disk, e.g. due to hardware failures or bit flips. While our mantra is
usually to follow upstream behavior, we do not do so in this case, as we
never check hashes of objects we have just read from disk.

To fix this, we create a new error class `GIT_EMISMATCH` which denotes
that we have looked up an object with a hashsum mismatch. `odb_read_1`
will then, after having read the object from its backend, hash the
object and compare the resulting hash to the expected hash. If hashes do
not match, it will return an error.

This obviously introduces another computation of checksums and could
potentially impact performance. Note though that we usually perform I/O
operations directly before doing this computation, and as such the
actual overhead should be drowned out by I/O. Running our test suite
seems to confirm this guess. On a Linux system with best-of-five
timings, we had 21.592s with the check enabled and 21.590s with the
ckeck disabled. Note though that our test suite mostly contains very
small blobs only. It is expected that repositories with bigger blobs may
notice an increased hit by this check.

In addition to a new test, we also had to change the
odb::backend::nonrefreshing test suite, which now triggers a hashsum
mismatch when looking up the commit "deadbeef...". This is expected, as
the fake backend allocated inside of the test will return an empty
object for the OID "deadbeef...", which will obviously not hash back to
"deadbeef..." again. We can simply adjust the hash to equal the hash of
the empty object here to fix this test.
2017-04-28 14:05:45 +02:00
Patrick Steinhardt
f4d1592c2f global: fix typo in git_libgit2_init description 2017-04-21 07:48:30 +00:00
Carlos Martín Nieto
8d89e40961 Merge pull request #4192 from libgit2/ethomson/win32_posix
Refactor some of the win32 POSIX emulation
2017-04-17 17:19:03 +02:00
Carlos Martín Nieto
5c76096046 transport: provide a getter for the proxy options
As with the callbacks, third-party implementations of smart subtransports cannot
reach into the opaque struct and thus cannot know what options the user set.

Add a getter for these options to copy the proxy options into something external
implementors can use.
2017-04-17 13:03:03 +02:00
Sven Strickroth
d5e6ca1e4a Allow to configure default file share mode for opening files
This can prevent FILE_SHARED_VIOLATIONS when used in tools such as TortoiseGit TGitCache and FILE_SHARE_DELETE, because files can be opened w/o being locked any more.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2017-04-03 23:13:00 +01:00
Remy Suen
a12796dd72 Correct typos that reference a non-existing file
There are references to odb_backends.h when the file is actually named
odb_backend.h and in the sys folder.
2017-04-03 21:25:53 +09:00
Edward Thomson
cc8d9a29e7 win32: introduce do_with_retries macro
Provide a macro that will allow us to run a function with posix-like
return values multiple times in a retry loop, with an optional cleanup
function called between invocations.
2017-04-01 10:47:30 +01:00
Edward Thomson
f623cf894a Merge pull request #4163 from pks-t/pks/submodules-with-worktrees
Worktree fixes
2017-03-22 20:32:55 +00:00
Edward Thomson
6fd6c67824 Merge pull request #4030 from libgit2/ethomson/fsync
fsync all the things
2017-03-22 20:29:22 +00:00
Remy Suen
84b4e5733d Use proper documentation tags
git_cred_acquire_cb isn't using the standard @param and @return tags.
This is causing the generated documentation to not be formatted
properly.
2017-03-22 06:08:24 +09:00
Remy Suen
12b7394cdd Fix typo in remote.h API 2017-03-20 22:30:37 +09:00
Patrick Steinhardt
3017ba94a3 worktree: implement git_worktree_open_from_repository
While we already provide functionality to look up a worktree from a
repository, we cannot do so the other way round. That is given a
repository, we want to look up its worktree if it actually exists.
Getting the worktree of a repository is useful when we want to get
certain meta information like the parent's location, getting the locked
status, etc.
2017-03-17 09:26:13 +01:00
Patrick Steinhardt
bb342159d8 merge_driver: fix const-correctness for source getters 2017-03-15 11:46:15 +01:00
Edward Thomson
2dfd1294f7 hash: include sha1collisiondetection
Include the SHA1 collision attack detection library from
https://github.com/cr-marcstevens/sha1collisiondetection
2017-03-03 10:50:27 +00:00
Edward Thomson
2a5ad7d0f2 fsync: call it "synchronous" object writing
Rename `GIT_OPT_ENABLE_SYNCHRONIZED_OBJECT_CREATION` ->
`GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`.
2017-02-28 13:29:01 +00:00
Edward Thomson
6d3ad7e09e Add ENABLE_SYNCHRONIZED_OBJECT_CREATION option
Allow users to enable `SYNCHRONIZED_OBJECT_CREATION` with a setting.
2017-02-28 13:27:49 +00:00
Edward Thomson
fc27fe213c odb_loose: actually honor the fsync option
We've had an fsync option for a long time, but it was "ignored".
Stop ignoring it.
2017-02-28 13:27:49 +00:00
David Catmull
19874e2934 Minor comment fix 2017-02-16 08:40:49 -07:00
Edward Thomson
a59545de5e Merge pull request #4122 from pks-t/pks/signature-dbl-free
Signature cleanups
2017-02-13 14:38:12 +00:00
Patrick Steinhardt
dc851d9eae commit: clear user-provided buffers
The functions `git_commit_header_field` and
`git_commit_extract_signature` both receive buffers used to hand back
the results to the user. While these functions called `git_buf_sanitize`
on these buffers, this is not the right thing to do, as it will simply
initialize or zero-terminate passed buffers. As we want to overwrite
contents, we instead have to call `git_buf_clear` to completely reset
them.
2017-02-13 13:50:52 +01:00
Edward Thomson
c576d4fff2 Merge pull request #4115 from gsaralms/users/gsaral/optionalOfsDelta
Changes to provide option to turn off/on ofs_delta
2017-02-13 12:46:00 +00:00
Patrick Steinhardt
1ba242c9ab worktree: extract git_worktree_is_prunable 2017-02-13 11:13:08 +01:00
Patrick Steinhardt
e3acd37b70 branch: implement git_branch_is_checked_out
Implement a new function that is able to determine if a branch is
checked out in any repository connected to the current
repository. In particular, this is required to check if for a
given repository and branch, there exists any working tree
connected to that repository that is referencing this branch.
2017-02-13 11:04:57 +01:00
Patrick Steinhardt
04fb12abb2 worktree: implement functions reading HEAD
Implement `git_repository_head_for_worktree` and
`git_repository_head_detached_for_worktree` for directly accessing a
worktree's HEAD without opening it as a `git_repository` first.
2017-02-13 11:03:01 +01:00
Patrick Steinhardt
f0cfc34105 worktree: implement git_worktree_prune
Implement the `git_worktree_prune` function. This function can be
used to delete working trees from a repository. According to the
flags passed to it, it can either delete the working tree's
gitdir only or both gitdir and the working directory.
2017-02-13 11:02:03 +01:00
Patrick Steinhardt
2a503485fa worktree: implement locking mechanisms
Working trees support locking by creating a file `locked` inside
the tree's gitdir with an optional reason inside. Support this
feature by adding functions to get and set the locking status.
2017-02-13 11:01:09 +01:00