summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* path: introduce git_fs_path_find_executableethomson/find_executableEdward Thomson2022-01-154-0/+200
| | | | | Provide a helper function to find an executable in the current process's PATH.
* win32: remove unnecessary findfile structureEdward Thomson2022-01-151-24/+20
|
* Merge remote-tracking branch 'pr/6159'Edward Thomson2022-01-061-1/+1
|\
| * #6154 git_status_list_new case insensitive fixMiguel Arroz2022-01-011-1/+1
| |
* | Merge pull request #6165 from libgit2/ethomson/includeifEdward Thomson2022-01-061-3/+14
|\ \ | | | | | | config: handle empty conditional in includeIf
| * | config: test allocation in config conditionalsethomson/includeifEdward Thomson2022-01-051-1/+3
| | |
| * | config: handle empty conditional in includeIfEdward Thomson2022-01-051-3/+12
| |/ | | | | | | | | | | When a config file contains `[includeIf]` (with no condition), we should treat that as a falsey value. This means that we should properly parse a config value of `includeIf.path`.
* | Add `rename_threshold` to `git_status_options`.Miguel Arroz2021-12-311-0/+3
|/
* remote: refactor insteadof applicationethomson/insteadofEdward Thomson2021-12-231-34/+28
| | | | | | | Using the insteadof helper would leak memory when we didn't really want the pushInsteadOf configuration. Refactor the choice into the function that allocates memory (or now, not) and use a more idiomatic `int` return code.
* worktree: checkout options suggestions from code reviewEdward Thomson2021-12-231-6/+6
|
* Change default checkout strategy from FORCE to SAFEpunkymaniac2021-12-231-2/+0
| | | | | | Since we are able to give our own git checkout options, the default git checkout strategy will be the same as initialized in a new git_checkout_options struct.
* Allow user checkout options on git_worktree_addpunkymaniac2021-12-231-1/+4
| | | | | | Extend the `git_worktree_add_options` to include `git_checkout_options`. github issue #5949
* Merge pull request #6142 from libgit2/ethomson/blob_data_is_binaryEdward Thomson2021-12-231-0/+9
|\ | | | | blob: identify binary content
| * blob: identify binary contentethomson/blob_data_is_binaryEdward Thomson2021-12-101-0/+9
| | | | | | | | | | Introduce `git_blob_data_is_binary` to examine a blob's data, instead of the blob itself. A replacement for `git_buf_is_binary`.
* | Merge pull request #6124 from csware/config-parsingEdward Thomson2021-12-231-5/+9
|\ \ | | | | | | Config parsing
| * | Multiline config values not preserved on savingSven Strickroth2021-12-061-4/+8
| | | | | | | | | | | | | | | | | | (fixes issue #6088) Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * | Config parsing confused by continuations that start with quotesSven Strickroth2021-12-061-1/+1
| | | | | | | | | | | | | | | | | | (fixes issue #6089) Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | | Merge pull request #6125 from stforek/git_commit_summary_spacesEdward Thomson2021-12-231-4/+15
|\ \ \ | | | | | | | | git_commit_summary: ignore lines with spaces
| * | | git_commit_summary: ignore lines with spacesPrzemyslaw Ciezkowski2021-11-251-4/+15
| |/ / | | | | | | | | | Fixes libgit2/libgit2#6065
* | | Merge pull request #6101 from mkhl/fix/instead-ofEdward Thomson2021-12-231-5/+25
|\ \ \ | | | | | | | | remotes: fix insteadOf/pushInsteadOf handling
| * | | remote: improve apply_insteadof function signatureMartin Kühl2021-11-111-9/+9
| | | |
| * | | fix remote/insteadof testsMartin Kühl2021-11-111-5/+25
| | | |
* | | | Merge pull request #6095 from yoichi/better-compatiblity-for-at-time-notationEdward Thomson2021-12-232-6/+15
|\ \ \ \ | | | | | | | | | | Better revparse compatibility for at time notation
| * \ \ \ Merge branch 'main' into better-compatiblity-for-at-time-notationYoichi Nakayama2021-11-2381-3096/+3214
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | Conflicts: src/revparse.c
| * | | | Add TODO comment for emit a warningYoichi Nakayama2021-10-221-0/+3
| | | | |
| * | | | Cause error when date parsing is failedYoichi Nakayama2021-10-222-3/+5
| | | | |
| * | | | Return the oldest reflog entry on revparse when older time is givenYoichi Nakayama2021-10-221-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | For better compatibility with git command which returns the oldest log entry with a warning message.
* | | | | Merge pull request #6094 from visualgitio/commit-graph-long-longEdward Thomson2021-12-231-2/+2
|\ \ \ \ \ | | | | | | | | | | | | Fix a long long that crept past
| * | | | | Simplifications to definitions to avoid UINT64_CCalvin Buckley2021-12-111-2/+2
| | | | | |
| * | | | | Also correct this long long constantCalvin Buckley2021-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I missed this because I searched for digits before ULL, otherwise it would match terms like "null" or "fully".
| * | | | | Fix a long long that crept pastCalvin Buckley2021-10-171-1/+1
| | | | | |
* | | | | | cmake: use PROJECT_SOURCE_DIR of CMAKE_SOURCE_DIRJosh Junon2021-12-231-13/+13
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also applies to *_BINARY_DIR. This effectively reverts 84083dcc8bd41332ccac9d7b537f3e254d79011c, which broke all users of libgit2 that use it as a CMake subdirectory (via `add_subdirectory()`). This is because CMAKE_SOURCE_DIR refers to the root-most CMake directory, which in the case of `add_subdirectory()` is a parent project to libgit2 and thus the paths don't make any sense to the configuration files. Corollary, CMAKE_SOURCE_DIR only makes sense if the CMake project is always the root project - which can rarely be guaranteed. In all honesty, CMake should deprecate and eventually remove CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. It's been the source of headaches and confusion for years, they're rarely useful over CMAKE_CURRENT_(SOURCE|BINARY)_DIR or PROJECT_(SOURCE|BINARY)_DIR, and they cause a lot of confusing configuration and source code layouts to boot. Any time they are used, they break `add_subdirectory()` almost 100% of the time, cause confusing error messages, and hide subtle bugs.
* | | | | object: introduce a raw content validation functionethomson/object_validationEdward Thomson2021-11-301-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | Users may want to validate raw object content; provide them a function to do so.
* | | | | object: return GIT_EINVALID on parse errorsEdward Thomson2021-11-307-38/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return `GIT_EINVALID` on parse errors so that direct callers of parse functions can determine when there was a failure to parse the object. The object parser functions will swallow this error code to prevent it from propagating down the chain to end-users. (`git_merge` should not return `GIT_EINVALID` when a commit it tries to look up is not valid, this would be too vague to be useful.) The only public function that this affects is `git_signature_from_buffer`, which is now documented as returning `GIT_EINVALID` when appropriate.
* | | | | Merge pull request #6122 from libgit2/ethomson/cleanupEdward Thomson2021-11-3013-33/+24
|\ \ \ \ \ | |_|_|/ / |/| | | | Minor code cleanups
| * | | | cmake: use CMAKE_SOURCE_DIR and CMAKE_BINARY_DIRethomson/cleanupEdward Thomson2021-11-221-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using the project-specific `libgit2_SOURCE_DIR` and `libgit2_BINARY_DIR` variables, use `CMAKE_SOURCE_DIR` and `CMAKE_BINARY_DIR`.
| * | | | filebuf: use hashes not oidsEdward Thomson2021-11-224-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The filebuf functions should use hashes directly, not indirectly using the oid functions.
| * | | | util: don't include unnecessary system librariesEdward Thomson2021-11-228-14/+5
| | | | | | | | | | | | | | | | | | | | Remove some unnecessary includes from utility code.
* | | | | Merge pull request #6106 from ammgws/fixtemplateerrEdward Thomson2021-11-221-1/+6
|\ \ \ \ \ | |/ / / / |/| | | | Fix repo init when template dir is non-existent
| * | | | repo: minor formatting fixEdward Thomson2021-11-221-2/+1
| | | | |
| * | | | repository: do not copy templates if dir nonexistentJason Nader2021-11-121-1/+7
| | |/ / | |/| | | | | | | | | | | | | | This mimics the behaviour of git which just prints a warning and continues with the repo initialisation.
* | | | date: rfc2822 formatting uses a `git_buf` instead of a static stringethomson/dateEdward Thomson2021-11-194-22/+25
| | | |
* | | | date: make it a proper `git_date` utility classEdward Thomson2021-11-185-24/+39
| | | | | | | | | | | | | | | | Instead of `git__date`, just use `git_date`.
* | | | tag: set validity to 0 by defaultethomson/tag_validEdward Thomson2021-11-161-0/+2
| | | | | | | | | | | | | | | | | | | | `git_tag_name_is_valid` needs to set validity to 0 when it short-circuits.
* | | | Make enum in src,tests and examples C90 compliant by removing trailing comma.Peter Pettersson2021-11-1533-40/+40
| | | |
* | | | cmake: move sha1 source selection into CMakeLists.txtEdward Thomson2021-11-141-0/+15
| | | | | | | | | | | | | | | | | | | | The select hashes module selects the hash; the CMakeLists.txt selects the files to implement it.
* | | | cmake: refactor global variablesEdward Thomson2021-11-141-15/+15
| | | | | | | | | | | | | | | | | | | | Update the global variables `LIBGIT2_OBJECTS` to `LIBGIT2_DEPENDENCY_OBJECTS` for clarity and consistency.
* | | | Merge pull request #6116 from ↵Edward Thomson2021-11-141-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | lhchavez/drop-volatile-qualifier-in-atomic-exchange
| * | | | Fix a gcc 11 warning in src/thread.hlhchavez2021-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building under gcc 11, there is a warning about an incompatible pointer type, since [`__atomic_exchange`](https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html) does not take `volatile` pointers: ``` In file included from ../src/common.h:81, from ../src/transports/winhttp.c:8: ../src/thread-utils.h: In function ‘git___swap’: ../src/thread-utils.h:168:9: warning: argument 3 of ‘__atomic_exchange’ discards ‘volatile’ qualifier [-Wincompatible-pointer-types] 168 | __atomic_exchange(ptr, &newval, &foundval, __ATOMIC_SEQ_CST); | ^~~~~~~~~~~~~~~~~ ``` This change drops the `volatile` qualifier so that the pointer type matches what `__atomic_exchange` expects.
* | | | | Fix a gcc 11 warning in src/threadstate.clhchavez2021-11-141-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building under gcc 11, there is a warning about a misaligned guard clause because there were mixed spaces and tabs: ``` [128/634] Building C object src/CMakeFiles/git2internal.dir/threadstate.c.o ../src/threadstate.c: In function ‘threadstate_dispose’: ../src/threadstate.c:39:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 39 | if (threadstate->error_t.message != git_str__initstr) | ^~ ../src/threadstate.c:41:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 41 | threadstate->error_t.message = NULL; | ^~~~~~~~~~~ ../src/threadstate.c: At top level: ``` This change indents the code with tabs for consistency with the rest of the code, which makes the warning go away.