Skip to content

Commit

Permalink
Merge branch 'jc/cache-tree' into jc/dirwalk-n-cache-tree
Browse files Browse the repository at this point in the history
* jc/cache-tree: (24 commits)
  Fix crash when reading the empty tree
  fsck-objects: do not segfault on missing tree in cache-tree
  cache-tree: a bit more debugging support.
  read-tree: invalidate cache-tree entry when a new index entry is added.
  Fix test-dump-cache-tree in one-tree disappeared case.
  fsck-objects: mark objects reachable from cache-tree
  cache-tree: replace a sscanf() by two strtol() calls
  cache-tree.c: typefix
  test-dump-cache-tree: validate the cached data as well.
  cache_tree_update: give an option to update cache-tree only.
  read-tree: teach 1-way merege and plain read to prime cache-tree.
  read-tree: teach 1 and 2 way merges about cache-tree.
  update-index: when --unresolve, smudge the relevant cache-tree entries.
  test-dump-cache-tree: report number of subtrees.
  cache-tree: sort the subtree entries.
  Teach fsck-objects about cache-tree.
  index: make the index file format extensible.
  cache-tree: protect against "git prune".
  Add test-dump-cache-tree
  Use cache-tree in update-index.
  ...
  • Loading branch information
Junio C Hamano committed May 20, 2006
2 parents 288c038 + b6c4a48 commit 283c8ee
Show file tree
Hide file tree
Showing 13 changed files with 830 additions and 128 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ git-write-tree
git-core-*/?*
test-date
test-delta
test-dump-cache-tree
common-cmds.h
*.tar.gz
*.dsc
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ DIFF_OBJS = \
diffcore-delta.o log-tree.o

LIB_OBJS = \
blob.o commit.o connect.o csum-file.o base85.o \
blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \
date.o diff-delta.o entry.o exec_cmd.o ident.o index.o \
object.o pack-check.o patch-delta.o path.o pkt-line.o \
quote.o read-cache.o refs.o run-command.o \
Expand Down Expand Up @@ -609,6 +609,9 @@ test-date$X: test-date.c date.o ctype.o
test-delta$X: test-delta.c diff-delta.o patch-delta.o
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^

test-dump-cache-tree$X: dump-cache-tree.o $(GITLIBS)
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)

check:
for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done

Expand Down
5 changes: 4 additions & 1 deletion apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
#include <fnmatch.h>
#include "cache.h"
#include "cache-tree.h"
#include "quote.h"
#include "blob.h"
#include "delta.h"
Expand Down Expand Up @@ -1917,6 +1918,7 @@ static void remove_file(struct patch *patch)
if (write_index) {
if (remove_file_from_cache(patch->old_name) < 0)
die("unable to remove %s from index", patch->old_name);
cache_tree_invalidate_path(active_cache_tree, patch->old_name);
}
if (!cached)
unlink(patch->old_name);
Expand Down Expand Up @@ -2018,8 +2020,9 @@ static void create_file(struct patch *patch)

if (!mode)
mode = S_IFREG | 0644;
create_one_file(path, mode, buf, size);
create_one_file(path, mode, buf, size);
add_index_file(path, mode, buf, size);
cache_tree_invalidate_path(active_cache_tree, path);
}

static void write_out_one_result(struct patch *patch)
Expand Down
Loading

0 comments on commit 283c8ee

Please sign in to comment.