| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Some callers -- like our test suite and the test suites of our language
bindings -- want to isolate the home directory to avoid accidentally
including the executing user's actual home directory data.
Previously, we combined the notion of a home directory and global
configuration -- now that this is separated, we provide users the
ability to configure both.
|
| |
|
|
|
|
|
|
| |
Users can specify a config file to be included in the home directory
using `~/filename` syntax. Instead of looking in the global
configuration location (which may be overridden), use the user's
_actual_ home directory. This allows callers to change the global
configuration location separately from the home directory.
|
| |
|
|
|
|
|
|
| |
Users can specify an attribute file to be included in the home
directory using `~/filename` syntax. Instead of looking in the
global configuration location (which may be overridden), use the
user's _actual_ home directory. This allows callers to change the
global configuration location separately from the home directory.
|
| |
|
|
|
| |
I spent an hour banging my head against this, when it was because the
remote didn't trust my key.
|
| |
|
|
|
|
|
| |
Use `git_sysdir_find_homedir_file` to identify the path to the home
directory's `.ssh/known_hosts`; this takes Windows paths into account by
preferring `HOME`, then falling back to `HOMEPATH` and `USERPROFILE`
directories.
|
| |
|
|
|
|
|
|
|
|
| |
Provide a mechanism to look up the user's home directory, using the same
mechanism that we use for locating the global configuration path (a
fancy name for saying "the home directory").
SSH known hosts lookups now use this, instead of simply looking at the
HOME environment variable, to support Windows-style home directory
lookups in `HOME`, `HOMEPATH`, or `USERPROFILE`.
|
| |
|
|
|
|
| |
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.
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| | |
`git_clone` checks for existence of (non-empty) directories that would clash with what is about to be cloned.
This is problematic when cloning submodules since they make sense in the context of a parent module, so they should not use the current working dir.
Since in `git_submodule_update` we clone the submodule only when it is not yet initialized we do not need to perform directory checks.
|
| | |
| |
| |
| |
| | |
211c97195e2ebcf68e27782715eb756823ad5a91 attempts to use the parsed OID
but inverted the arguments to `git_oid_cpy`.
|
| |\ \
| | |
| | | |
push: revparse refspec source, so you can push things that are not refs
|
| | | |
| | |
| | |
| | | |
I want to push a commit by OID to a remote branch. Currently, push parses the refspecs such that the source must be the name of a ref (it uses git_reference_name_to_id to resolve it). This commit changes it so push uses git_revparse_single to resolve the source of the refspec. This allows for OIDs or other revs (e.g. `HEAD~2`) to be pushed.
|
| |\ \ \
| | | |
| | | | |
transport: fix capabilities calculation
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This looks like a typo to me, from what i can see these lines were
added at the same time and because of how capabilities are calculated,
it's likely that this code will work in situations where these
capabilities were the last ones.
|
| |\ \ \ \
| |_|_|/
|/| | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The server and client negotiate a single hostkey, but the "best" cipher may not
be the one for which we have an entry in `known_hosts`. This can lead to us not
finding the key in known_hosts even though we should be connecting.
Instead here we look up the hostname with a nonsense key to perform a lookup in
the known hosts and set that. This is roughly what the OpenSSH client does as
well.
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
It turns out this has been available in libssh2 for a long time and we should
have been verifying this the whole time.
|
| | |/ /
|/| |
| | |
| | |
| | | |
If a submodule has been configured but not yet added, do not try to update it.
Issue #6433: git_submodule_update fails to update configured but missing submodule
|
| |\ \ \
| | | |
| | | | |
Add support for "safe.directory *"
|
| | | | |
| | | |
| | | |
| | | | |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| |\ \ \ \
| |/ / /
|/| | | |
http: Update httpclient options when reusing an existing connection.
|
| | |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Httpclient internally stores a copy of the certificate_check callback and
payload. When connecting via HTTPS, and if the server sends back
"Connection: close" after the first request, the following request would
attempt to re-use the httpclient and call the (now outdated) callback. In
particular for pygit2 this is a problem, since callbacks / payloads are only
valid for the duration of a libgit2 call, leading to a ffi.from_handle()
error and crashing the Python interpreter.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
julianmesa-gitkraken/fix-leak-git_tag_create_from_buffer
Fix leak in git_tag_create_from_buffer
|
| | | | | |
|
| | | | | |
|
| | |/ /
| | |
| | |
| | | |
If the tag already exists and we are not forcing overwrite we need to free ref_name buffer before return the "tag already exists" error.
|
| |\ \ \
| | | |
| | | | |
Ignore missing 'safe.directory' config during ownership checks
|
| | |/ / |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This should resolve some issues with UBSan builds by using unsigned
64-bit integers for all arithmetic until we finally convert to an offset
or size value.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
|
| |/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |\ \
| | |
| | | |
Support non-cmake builds with an in-tree `experimental.h`
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Not everybody builds libgit2 using cmake; provide an `experimental.h`
with no experiments configured for those that do not. To support this,
we also now create compile definitions for experimental functionality,
to supplant that empty `experimental.h`. cmake will continue to generate
the proper `experimental.h` file for use with `make install`.
|
| |\ \ \
| | | |
| | | | |
#6366: When a worktree is missing, return GIT_ENOTFOUND.
|
| | | |/
| |/| |
|
| |\ \ \
| |_|/
|/| | |
Don't fail the whole clone if you can't find a default branch
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Only allow the remote default branch checking to fail when the remote
default branch doesn't exist (`git_remote__default_branch` returns
`GIT_ENOTFOUND`). If there was any other type of error - for example, an
allocation failure - we should not swallow that and continue to fail.
This allows us to support the case when a remote has not advertised a
HEAD -- this is possible, for example, when the remote has constrained
the caller to a particular namespace. But other remote failures remain
as failures.
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In commit 6bb358786 ("clone: set refs/remotes/origin/HEAD to default
branch when branch is specified, attempt 2") libgit2 was changed to set
the default remote branch when one was copied.
But it makes update_head_to_branch() return an error if the origin
doesn't even *have* a HEAD in the first place, since
git_remote_default_branch() will fail.
That's entirely wrong, and means that you cannot do "git_clone()" of a
particular branch on a remote repository when that remote doesn't have a
default branch at all.
So don't set the error code.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
| |/ |
|
| |
|
|
|
| |
The experimental function signature is only available when
`GIT_EXPERIMENTAL_SHA256` is enabled.
|
| |\
| |
| | |
RFC: SHA256 proof of concept
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
libgit2 can be built with optional, experimental sha256 support. This
allows consumers to begin testing and providing feedback for our sha256
support while we continue to develop it, and allows us to make API
breaking changes while we iterate on a final sha256 implementation.
The results will be `git2-experimental.dll` and installed as
`git2-experimental.h` to avoid confusion with a production libgit2.
|
| | |
| |
| |
| |
| | |
Linux has a /usr/include/features.h, which gets confusing; update this
to `git2_features.h` and move it into the `util` directory.
|
| | |
| |
| |
| | |
Teach the loose object database how to cope with SHA256 objects.
|
| | |
| |
| |
| | |
Tidy up `nfmt` / `pathfmt`.
|
| | |
| |
| |
| | |
Move the arguments to `git_odb_loose` into an options structure.
|
| | |
| |
| |
| |
| | |
Allow the object database to take an oid type that it supports. This
oid type will be used to validate the objects that the backends provide.
|
| | |
| |
| |
| |
| | |
Users will need to be able to specify the object id type for the given
object database; add a new `git_odb_options` with that option.
|
| | |
| |
| |
| |
| | |
The git_odb_hash helper functions should not assume SHA1, and instead
should be given the oid type that they're producing.
|
| | |
| |
| |
| |
| |
| | |
We intentionally separate oid types from hash types; a hash is a generic
hunk of bytes, an object id has meaning and backs an object on disk. As
a result of this separation, we need a 1:1 mapping.
|
| | | |
|