Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-13 06:33:16 +0400
committerJunio C Hamano <junkio@cox.net>2006-08-13 06:33:16 +0400
commit647377c4c91064fc5001acddd5357467c0da6ef9 (patch)
treeef5ee52aaf3b2f0b8e070153b47b9248aa32eed5 /builtin-pack-objects.c
parenteb4541569d4fdfb1cbdf503cfbf433e63d79b663 (diff)
parent8e27364128b091e76059229d4f009bc7f869fa9f (diff)
Merge branch 'jc/pack-objects'
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 2301cd5c0f..2f9921224d 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -270,6 +270,22 @@ static unsigned long write_object(struct sha1file *f,
* and we do not need to deltify it.
*/
+ if (!entry->in_pack && !entry->delta) {
+ unsigned char *map;
+ unsigned long mapsize;
+ map = map_sha1_file(entry->sha1, &mapsize);
+ if (map && !legacy_loose_object(map)) {
+ /* We can copy straight into the pack file */
+ sha1write(f, map, mapsize);
+ munmap(map, mapsize);
+ written++;
+ reused++;
+ return mapsize;
+ }
+ if (map)
+ munmap(map, mapsize);
+ }
+
if (! to_reuse) {
buf = read_sha1_file(entry->sha1, type, &size);
if (!buf)