| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
Keeping the cache around after read-tree is only one part of the
optimisation opportunities. In order to share the cache between program
instances, we need to write the TREE extension to the index.
Do so, taking the opportunity to rename 'entries' to 'entry_count' to
match the name given in the format description. The included test is
rather trivial, but works as a sanity check.
|
| |
|
|
|
| |
This wasn't used. We invalidate based on the full path, so we always go
down the tree, never up.
|
| |
|
|
|
|
| |
When reading from a tree, we know what every tree is going to look like,
so we can fill in the tree cache completely, making use of the index for
modification of trees a lot quicker.
|
| |
|
|
|
|
| |
This simplifies freeing the entries quite a bit; though there aren't
that many failure paths right now, introducing filling the cache from a
tree will introduce more. This makes sure not to leak memory on errors.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
While I was looking at the conflict cleanup code, I looked over at
the tree cache code, since we clear the tree cache for each entry
that gets removed and there is some redundancy there. I made some
small tweaks to avoid extra calls to strchr and strlen in a few
circumstances.
|
| | |
|
| |
|
|
| |
Signed-off-by: schu <schu-github@schulog.org>
|
| |
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
| |
|
|
|
|
|
| |
Whenever a file is updated in the index, each tree leading towards it
needs to be invalidated. Provide the supporting function.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
| |
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
Rename git_index_tree to git_tree_cache.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|