Code

Merge branch 'jc/maint-1.6.0-keep-pack' into maint-1.6.1
authorJunio C Hamano <gitster@pobox.com>
Sun, 3 May 2009 22:01:31 +0000 (15:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 3 May 2009 22:01:31 +0000 (15:01 -0700)
* jc/maint-1.6.0-keep-pack:
  pack-objects: don't loosen objects available in alternate or kept packs
  t7700: demonstrate repack flaw which may loosen objects unnecessarily
  Remove --kept-pack-only option and associated infrastructure
  pack-objects: only repack or loosen objects residing in "local" packs
  git-repack.sh: don't use --kept-pack-only option to pack-objects
  t7700-repack: add two new tests demonstrating repacking flaws
  is_kept_pack(): final clean-up
  Simplify is_kept_pack()
  Consolidate ignore_packed logic more
  has_sha1_kept_pack(): take "struct rev_info"
  has_sha1_pack(): refactor "pretend these packs do not exist" interface
  git-repack: resist stray environment variable

1  2 
builtin-count-objects.c
builtin-fsck.c
builtin-pack-objects.c
cache.h
diff.c
git-repack.sh
revision.c
revision.h
sha1_file.c

Simple merge
diff --cc builtin-fsck.c
Simple merge
Simple merge
diff --cc cache.h
index 15675701fd64d53cff9c27505cac6f4f14b1341d,23c16d0d99777cc9a6f23c6b23fb16d837b1742c..8bc6bf32505a0bdccee839971618a8b545832a42
+++ b/cache.h
@@@ -832,10 -744,9 +832,9 @@@ extern const unsigned char *nth_packed_
  extern off_t nth_packed_object_offset(const struct packed_git *, uint32_t);
  extern off_t find_pack_entry_one(const unsigned char *, struct packed_git *);
  extern void *unpack_entry(struct packed_git *, off_t, enum object_type *, unsigned long *);
 -extern unsigned long unpack_object_header_gently(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
 +extern unsigned long unpack_object_header_buffer(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
  extern unsigned long get_size_from_delta(struct packed_git *, struct pack_window **, off_t);
  extern const char *packed_object_info_detail(struct packed_git *, off_t, unsigned long *, unsigned long *, unsigned int *, unsigned char *);
- extern int matches_pack_name(struct packed_git *p, const char *name);
  
  /* Dumb servers support */
  extern int update_server_info(int);
diff --cc diff.c
Simple merge
diff --cc git-repack.sh
Simple merge
diff --cc revision.c
Simple merge
diff --cc revision.h
Simple merge
diff --cc sha1_file.c
index 3d93d936e4e3ddf24f46af2ef92e62e5f7db3877,500fd93127246fad72edca165fd4673070813f82..2320400b7c48dc3f2303eb0c08933cb562155729
@@@ -2043,17 -1956,10 +2016,17 @@@ int sha1_object_info(const unsigned cha
  
                /* Not a loose object; someone else may have just packed it. */
                reprepare_packed_git();
-               if (!find_pack_entry(sha1, &e, NULL))
+               if (!find_pack_entry(sha1, &e))
                        return status;
        }
 -      return packed_object_info(e.p, e.offset, sizep);
 +
 +      status = packed_object_info(e.p, e.offset, sizep);
 +      if (status < 0) {
 +              mark_bad_packed_object(e.p, sha1);
 +              status = sha1_object_info(sha1, sizep);
 +      }
 +
 +      return status;
  }
  
  static void *read_packed_sha1(const unsigned char *sha1,