Code

Merge branch 'jc/cache-tree' into next
authorJunio C Hamano <junkio@cox.net>
Tue, 25 Apr 2006 04:28:07 +0000 (21:28 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 25 Apr 2006 04:28:07 +0000 (21:28 -0700)
* jc/cache-tree:
  index: make the index file format extensible.
  cache-tree: protect against "git prune".
  Add test-dump-cache-tree

1  2 
.gitignore
Makefile
update-index.c

diff --cc .gitignore
index 145f8555ad4b5c13cb7a6076cf7d9e809beff952,7906909b306f80ed74d6e53bb8514a889057194c..cdb2d53318148dbfde43cbcf218abcbb5cf5a434
@@@ -123,7 -123,7 +123,8 @@@ git-write-tre
  git-core-*/?*
  test-date
  test-delta
+ test-dump-cache-tree
 +test-gsimm
  common-cmds.h
  *.tar.gz
  *.dsc
diff --cc Makefile
index 589dbe1d8b27371157018c438173847995b2465b,1aa96f4f2e166afa3234264fdb4832bdbd535677..41a0d93a6cc7fa075fb1b66eaf40a2907c8bc296
+++ b/Makefile
@@@ -611,9 -611,9 +611,12 @@@ test-date$X: test-date.c date.o ctype.
  test-delta$X: test-delta.c diff-delta.o patch-delta.o
        $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^ -lz
  
+ test-dump-cache-tree$X: dump-cache-tree.o $(GITLIBS)
+       $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
 +test-gsimm$X: test-gsimm.c gsimm.o rabinpoly.o
 +      $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^
 +
  check:
        for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done
  
diff --cc update-index.c
index ea1a3770573dd00654ea6c7d00ae8b5d7a9387f8,d6d3295e329ed2d0f1f46824a210b86c0c092b8f..157488ff1a87df262e6177671f5e568b8d155de3
@@@ -6,13 -6,8 +6,9 @@@
  #include "cache.h"
  #include "strbuf.h"
  #include "quote.h"
- #include "tree.h"
 +#include "tree-walk.h"
  #include "cache-tree.h"
  
- static unsigned char active_cache_sha1[20];
- static struct cache_tree *active_cache_tree;
  /*
   * Default to not allowing changes to the list of files. The
   * tool doesn't actually care, but this makes it harder to add
@@@ -764,14 -624,10 +759,12 @@@ int main(int argc, const char **argv
                                free(path_name);
                }
        }
 +
 + finish:
        if (active_cache_changed) {
-               if (write_cache_1(newfd, active_cache, active_nr,
-                                 active_cache_sha1) ||
+               if (write_cache(newfd, active_cache, active_nr) ||
                    commit_index_file(&cache_file))
                        die("Unable to write new cachefile");
-               write_cache_tree(active_cache_sha1, active_cache_tree);
        }
  
        return has_errors ? 1 : 0;