| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This makes the API for commiting or discarding changes the same as for
references.
|
|
|
|
|
|
|
|
|
| |
This lock/unlock pair allows for the cller to lock a configuration file
to avoid concurrent operations.
It also allows for a transactional approach to updating a configuration
file. If multiple updates must be made atomically, they can be done
while the config is locked.
|
|
|
|
|
|
|
| |
When a configuration file is locked, any updates made to it will be done
to the in-memory copy of the file. This allows for multiple updates to
happen while we hold the lock, preventing races during complex
config-file manipulation.
|
|
|
|
|
|
|
|
|
|
| |
Instead of writing into the filebuf directly, make the functions to
write the modified config file write into a buffer which can then be
dumped into the lockfile for committing.
This allows us to re-use the same code for modifying a locked
configuration, as we can simply skip the last step of dumping the data
to disk.
|
|\
| |
| | |
Forcing libssh2 lib location in CMake
|
|/
|
|
| |
OS X may have libssh2 in diff locations, so CHECK_LIBRARY_EXISTS may check the wrong lib; forcing it to use a found directory.
|
|\
| |
| | |
Fix duplicate basenames to support older VS on master
|
|/
|
|
|
|
|
| |
With Visual Studio versions 2008 and older they ignore the full path to files and only check
the basename of the file to find a collision. Additionally, having duplicate basenames can break
other build tools like GYP.
This fixes https://github.com/libgit2/libgit2/issues/3356
|
|\
| |
| | |
Error handling: use buffers, improved OOM handling
|
| |
| |
| |
| |
| | |
When an error state is an OOM, make sure that we treat is specially
and do not try to free it.
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of allocating a brand new buffer for each error string we want
to store, we can use a per-thread buffer to store the error string and
re-use the underlying storage. We already use the buffer to format the
string, so this mostly makes that more direct.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Allow restoring a previously captured oom error, by
detecting when the captured message pointer points to the
static oom error message. This means there is no need
to strdup the message in giterr_detach.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Error messages that are detached are assumed to be dynamically
allocated. Passing a pointer to the static oom error message
can cause an attempt to free the static buffer later. This change
checks if the oom error message is about to be detached and detaches
a copy instead.
|
|/ / |
|
|\ \
| | |
| | | |
filebuf: remove lockfile upon rename errors
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When we have an error renaming the lockfile, we need to make sure
that we remove it upon cleanup. For this, we need to keep track of
whether we opened the file and whether the rename succeeded.
If we did create the lockfile but the rename did not succeed, we
remove the lockfile. This won't protect against all errors, but
the most common ones (target file is open) does get handled.
|
| | |
| | |
| | |
| | |
| | | |
When we fail to rename, we currently leave the lockfile laying
around. This shows that behaviour.
|
|\ \ \
| | | |
| | | | |
index: stage an unregistered submodule as well
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We previously added logic to `_add_bypath()` to update a submodule. Go
further and stage the submodule even if it's not registered to behave
like git.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When we pass the path of a repository to `_bypath()`, we should behave
like git and stage it as a `_COMMIT` regardless of whether it is
registered a a submodule.
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | | |
Handle ssh:// and git:// urls containing a '~' character.
|
|/ / /
| | |
| | |
| | |
| | | |
For such a path '/~/...' the leading '/' is stripped so the server will
get a path starting with '~' and correctly handle it.
|
|\ \ \
| | | |
| | | | |
Resolve documentation warnings
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Remove extra semicolon outside of a function
|
|/ / / /
| | | |
| | | |
| | | |
| | | | |
Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.
|
|\ \ \ \
| | | | |
| | | | | |
iterator: skip over errors in diriter init
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We don't want the iterator to make us stop whenever we hit an unreadable
dir. We should instead move over to the next item.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
An error here will typically mean that the directory was removed between
the time we iterated the parent and the time we wanted to visit it in
which case we should ignore it.
Other kinds of errors such as permissions (or transient errors) also
better dealt with by pretending we didn't see it.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
case-insensitive check for WWW-Authenticate header
|
|/ / / /
| | | |
| | | | |
Fixes issue #3338
|
|\ \ \ \
| | | | |
| | | | | |
Normalize submodule urls before looking at them
|
| | | | |
| | | | |
| | | | |
| | | | | |
Extract the backslash-to-slash conversion into a helper function.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Our path functions expect to work with slashes, so convert a
path with backslashes into one with slashes at the top of
the function.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Allow adding a submodule through git_index_add_bypath
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Similarly to how git itself does it, allow the index update operation to
stage a change in a submodule's HEAD.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This also affects `git_index_add_bypath()` by providing a better error
message and a specific error code when a directory is passed.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is to be returned when the operation which the user asked for is
not possible to do on a directory.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
refdb: delete a ref's reflog upon deletion
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Removing a reflog upon ref deletion is something which only some
backends might wish to do. Backends which are database-backed may wish
to archive a reflog, log-based ones may not need to do anything.
|
|\ \ \ \ \ \
| |_|_|_|_|/
|/| | | | | |
filter: make sure to close the stream even on error
|