Commit Graph

13457 Commits

Author SHA1 Message Date
Edward Thomson
8a0dc6783c Merge pull request #5931 from libgit2/ethomson/1.1.1
Release v1.1.1
v1.1.1
2021-06-30 13:35:07 -05:00
Edward Thomson
9a3a7c1f80 Release v1.1.1 2021-06-30 10:14:07 -05:00
Edward Thomson
b06736af4b README: only show 1.1 build status 2021-06-30 09:45:21 -05:00
Edward Thomson
deb1ce4c16 Merge pull request #5921 from libgit2/ethomson/1.1.1
Bug fixes for v1.1.1
2021-06-30 09:38:22 -05:00
Jacques Germishuys
0cb432ae3e define WINHTTP_NO_CLIENT_CERT_CONTEXT if needed 2021-06-30 08:58:13 -05:00
Edward Thomson
9e2eaee5ec tests: improved integer compare in stacktrace test 2021-06-30 08:58:13 -05:00
Edward Thomson
f73f2caccf tests: cleanup repo::init::symlinks_win32_enabled_by_global_config 2021-06-30 08:58:13 -05:00
Edward Thomson
1bd2f79508 refspec: return GIT_EINVALIDSPEC for invalid specs
Disambiguate invalid specifications in `git_refspec__parse` so that
callers can determine the difference between invalid specifications and
actual errors.  No call sites wil propagagte this new error message to
an end-user, so there is no user-facing API change.
2021-06-30 08:58:13 -05:00
punkymaniac
9246d73326 Add some missing documentation about return value 2021-06-30 08:58:13 -05:00
punkymaniac
9ce08282e9 Fix struct indentation 2021-06-30 08:58:13 -05:00
punkymaniac
b74445d472 Remove bad space in documentation 2021-06-30 08:58:13 -05:00
punkymaniac
afa0b6d7c6 Add documentation about GIT_OPT_GET_USER_AGENT 2021-06-30 08:58:13 -05:00
Waleed Khan
ac7ca56652 Fix misleading doc for git_index_find
In fc46dc06f5 (r540092847), I was confused by the semantics of `git_index_find`. The documentation says both that it returns the output value in `at_pos` and that it returns it directly as an `int`. This is incorrect; the return value is only returned via `at_pos`.
2021-06-30 08:58:13 -05:00
David Tolnay
5f7df15de5 Tolerate readlink size less than st_size 2021-06-30 08:58:13 -05:00
Tyler Ang-Wanek
c78c7ee615 httpclient: no proxy creds in requests if proxy is CONNECT type 2021-06-30 08:58:13 -05:00
Tyler Ang-Wanek
283285703d httpclient: git_http_client_skip_body should drain socket of body 2021-06-30 08:58:13 -05:00
punkymaniac
973094232f Fix typo 2021-06-30 08:58:12 -05:00
punkymaniac
e5efc4179b Uniformise documentation return code separator 2021-06-30 08:58:12 -05:00
punkymaniac
38e476f83d Fix documentation formatting
The return code description use '-' char as list of return value.
But with the generation of the documentation the char '-' create an
ambiguous return code value who seem an negative value.
2021-06-30 08:58:12 -05:00
Kartikaya Gupta
3c54573919 Add testcase 2021-06-30 08:58:12 -05:00
Kartikaya Gupta
99ba19c45d diff: Fix bug in git_diff_find_similar.
When a split src gets turned into a rename, it should
also lose the IS_RENAME_TARGET flag, so that it doesn't
get processed in a subsequent iteration as a rename target.
Doing so can cause an assertion failure because it no
longer has the SPLIT flag.

Fixes #5811.
2021-06-30 08:58:12 -05:00
Carlos Martín Nieto
168cc6d02d repo: remove an inappropriate use of PASSTHROUGH
This error code is for callbacks where we should act as though the callback was
not set. This is not something that makes sense for a `_foreach` and checking
for that error message to bubble up mostly is happenstance precisely because
this is not an error code we expect in the callback.

As part of removing this, let's also remove a use of foreach as we can open-code
this check.
2021-06-30 08:58:12 -05:00
Carlos Martín Nieto
1498517179 repo: specify init.defaultbranch is meant to be a branch name
We don't want the default branch's refname here but its name as branch.
Returning an error saying it's not a valid reference here suggests we want the
value of `init.defaultbranch` to be something like `refs/heads/default` which is
not the case.
2021-06-30 08:58:12 -05:00
Marco Sirabella
14ef0f58ea Fix diff_entrycount -> diff_num_deltas doc typo
This just fixes a typo in the documentation, actual rename change was
done in 5f69a31f
2021-06-30 08:58:12 -05:00
Ian Hattendorf
b31f50fdf6 Default to GIT_BRANCH_DEFAULT if init.defaultBranch is empty string
We already do this in repo_init_head
2021-06-30 08:58:12 -05:00
Ian Hattendorf
8b16a4aa0f winhttp: skip certificate check if unable to send request
In some circumstances (e.g. when proxies are involved), winhttp will fail to reach the WINHTTP_CALLBACK_STATUS_SENDING_REQUEST phase. If this occurs, we'll error with ERROR_WINHTTP_INCORRECT_HANDLE_STATE when attempting to query the server certificate context (see https://docs.microsoft.com/en-us/windows/win32/api/winhttp/nf-winhttp-winhttpsendrequest#remarks).

To avoid this, verify that WinHttpSendRequest has reached the WINHTTP_CALLBACK_STATUS_SENDING_REQUEST phase before checking the certificate. Since we're using WinHTTP in synchronous mode, we know for sure that once WinHttpSendRequest returns we've either sent it successfully or not.

NOTE: WINHTTP_CALLBACK_STATUS_SENDING_REQUEST appears to be deprecated with no direct replacement. WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE is only available in async mode, and there doesn't appear to be a method of querying this flag outside of the status callback.
2021-06-30 08:58:12 -05:00
Ian Hattendorf
9bdc0b000f winhttp: test proxy https clone 2021-06-30 08:58:12 -05:00
panda
a0acf60e97 merge: Check insert_head_ids error in create_virtual_base
insert_head_ids can fail due to allocation error
2021-06-30 08:58:12 -05:00
panda
c0358ee13d Check git_signature_dup failure
git_signature_dup can have an allocation failure
2021-06-30 08:58:12 -05:00
Tobias Nießen
5aea17f645 include: fix typos in comments 2021-06-30 08:58:12 -05:00
punkymaniac
ead10a88c4 Fix documentation formating on repository.h
The enum 'git_repository_init_flag_t', 'git_repository_init_mode_t' and
the structure 'git_repository_init_options' does not follow the format
used by docurium.
2021-06-30 08:58:12 -05:00
panda
7f1dd4452e index: Initialize case_sorted to GIT_VECTOR_INIT
This is for extra safety within write_entries
2021-06-30 08:58:12 -05:00
panda
f4c0519216 index: Check git_vector_dup error in write_entries
If allocating case_sorted.contents fails, git_vector_sort will segfault.
2021-06-30 08:58:12 -05:00
panda
3f56baf8a1 refdb_fs: Check git_sortedcache wlock/rlock errors
To prevent a race condition, these wlock/rlock calls should probably be checked
for errors.
2021-06-30 08:58:12 -05:00
lhchavez
9210461038 mwindow: Fix a bug in the LRU window finding code
This change now updates the `lru_window` variable to match the current
file's MRU window. This makes it such that it doesn't always choose the
file that happened to come last in the list of window files, and instead
should now correctly choose the file with the least-recently-used one.
2021-06-30 08:58:12 -05:00
Edward Thomson
854ffd2b99 clone: set refs/remotes/origin/HEAD when branch is specified
When a branch is specified to check out in clone, update the remote
tracking `HEAD` to point to it.  This mimics git's behavior, when
`git clone -b <name>` is used.
2021-06-30 08:58:12 -05:00
lhchavez
ec097b7bab Use p_pwrite/p_pread consistently throughout the codebase
This change stops using the seek+read/write combo to perform I/O with an
offset, since this is faster by one system call (and also more atomic
and therefore safer).
2021-06-30 08:58:12 -05:00
Edward Thomson
bb278ceb37 repo: ignore empty init.defaultbranch
The init.defaultbranch option may be set, but empty.  In this case, we
should ignore it instead of trying to set our default branch to
`refs/heads/`.
2021-06-30 08:58:12 -05:00
Edward Thomson
a242d43d72 remote: don't update invalid refs
If a symbolic reference points to something invalid, then do not try to
update it.
2021-06-30 08:58:12 -05:00
Edward Thomson
d81a85c5c2 fetch: test when HEAD points to nonexistent branch
When HEAD points to a nonexistent or invalid branch - for example, to
`refs/heads/` - the fetch should be permitted to continue, but we should
not use it when creating the `for merge` option in the FETCH_HEAD file.

(This emulates git's behavior.)
2021-06-30 08:58:12 -05:00
Josh Stockin
45346db844 Update documentation for git_blob_filter_options
Adds info about initializing options with git_blob_filter_options_init
2021-06-30 08:58:12 -05:00
Edward Thomson
b9e8758601 blob: add git_blob_filter_options_init
The `git_blob_filter_options_init` function should be included, to allow
callers in FFI environments to let us initialize an options structure
for them.
2021-06-30 08:58:12 -05:00
Josh Stockin
2a6a251869 Fix documentation for git_blob_filter_options 2021-06-30 08:58:12 -05:00
Josh Stockin
76bfc25f22 Move doc comment about GIT_BLOB_FILTER_OPTIONS_VERSION
Removes doc comment on `git_blob_filter_options.version`, moves
information to `git_blob_filter_options` doc comment to remain
consistent with other options structures' documentation.

`git_blob_filter_options_init` still needed; should be added in another
commit/PR (it's out of the scope of this PR, #5759), update this
documentation again.
2021-06-30 08:58:12 -05:00
Josh Stockin
faa78e1751 Add documentation for git_blob_filter_options.version
Resolves #5756
2021-06-30 08:58:12 -05:00
Dhruva Krishnamurthy
d593e3e85f Support build with NO_MMAP to disable use of system mmap
* Use pread/pwrite to avoid updating position in file descriptor
    * Emulate missing pread/pwrite on win32 using overlapped file IO
2021-06-30 08:58:12 -05:00
Dhruva Krishnamurthy
d77c073f09 Remove broken support for write in emulated mmap
* Emulated mmap based write without pagefault handling is not
    possible since IO happens outside of call to mmap and data is
    written to mapped memory
    * Potential emulation using userfaultfd() might be possible
2021-06-30 08:58:12 -05:00
Edward Thomson
c0e16a467d pack: continue zlib while we can make progress
Continue the zlib stream as long as we can make progress; stop when we
stop getting output _or_ when zlib stops taking input from us.
2021-06-30 08:58:12 -05:00
Edward Thomson
97c03eae5a Apply suggestions from code review 2021-06-30 08:58:12 -05:00
Reginald McLean
ea383d802e worktree: change test to invalidate worktree via filesystem 2021-06-30 08:58:12 -05:00