Commit Graph

10 Commits

Author SHA1 Message Date
Vicent Martí
3f0358604e misc: Fix warnings from PVS Studio trial 2012-06-07 22:43:48 +02:00
Vicent Martí
3fbcac89c4 Remove old and unused error codes 2012-05-02 19:56:38 -07:00
Carlos Martín Nieto
2218fd57a5 tree-cache: don't error out on a childless invalidated entry
The code used to assume that there had to be data after the newline in
a tree cache extension entry. This isn't true for a childless
invalidated entry if it's the last one, as there won't be any children
nor a hash to take up space.

Adapt the off-by-one comparison to also work in this case. Fixes #633.
2012-04-23 10:41:43 -07:00
schu
5e0de32818 Update Copyright header
Signed-off-by: schu <schu-github@schulog.org>
2012-02-13 17:11:09 +01:00
Vicent Marti
3286c408ec global: Properly use git__ memory wrappers
Ensure that all memory related functions (malloc, calloc, strdup, free,
etc) are using their respective `git__` wrappers.
2011-10-28 19:02:36 -07:00
Carlos Martín Nieto
3ba69ba8a4 Add git_tree_cache_get
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
69bffab969 Add git_tree_cache_invalidate_path
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>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
acd31b4ad6 tree cache: correctly handle invalidated trees
The fix introduced in a02fc2cd1 (2011-05-24; index: correctly parse
invalidated TREE extensions) threw out the rest of the data in the
extension if it found an invalidated entry. This was the result of
incorrect reading of the documentation.

Insted, keep reading the extension, as there may be cached data we can
use.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
b183ffe77e Make tree cache name a flex-array
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
b41713206b Move the tree cache functions to their own file
Rename git_index_tree to git_tree_cache.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00