| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| | |
Include fixups
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Next to including several files, our "common.h" header also declares
various macros which are then used throughout the project. As such, we
have to make sure to always include this file first in all
implementation files. Otherwise, we might encounter problems or even
silent behavioural differences due to macros or defines not being
defined as they should be. So in fact, our header and implementation
files should make sure to always include "common.h" first.
This commit does so by establishing a common include pattern. Header
files inside of "src" will now always include "common.h" as its first
other file, separated by a newline from all the other includes to make
it stand out as special. There are two cases for the implementation
files. If they do have a matching header file, they will always include
this one first, leading to "common.h" being transitively included as
first file. If they do not have a matching header file, they instead
include "common.h" as first file themselves.
This fixes the outlined problems and will become our standard practice
for header and source files inside of the "src/" from now on.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
The open-coded version was inherited from git.git. But it
turns out it was based on an older version of glibc, whose
memcmp was not very optimized.
Modern glibc does much better, and some compilers (like gcc
7) can even inline the memcmp into a series of multi-byte
xors.
Upstream is switching to using memcmp in
git/git@0b006014c87f400bd9a86267ed30fd3e7b383884.
|
| |
|
|
|
| |
Query the object database for multiple objects at a time, given their
object ID (which may be abbreviated) and optional type.
|
| |
|
|
|
|
| |
The old `allocfmt` is of no use to callers, as they are not able to free
the returned buffer. Export a new API that returns a static string that
doesn't need to be freed.
|
| | |
|
| | |
|
| |
|
|
| |
Drop redundant methods. The ncmp method is now public
|
| |
|
|
|
|
| |
As suggested by carlosmn, git_oid_ncmp would probably
be a better name than git_oid_match, for it does the same
as git_oid_cmp but only up to a certain amount of hex digits.
|
| |
|
|
| |
compare methods (0 means oids match). Added method to compare prefixes of hex formatted oids.
|
|
|
nth hexadecimal characters (i.e. packets of 4 bits) of OIDs.
|