Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Make trivial wrapper functions around delta base generation and freeing
author
Linus Torvalds
<torvalds@linux-foundation.org>
Sat, 17 Mar 2007 19:42:15 +0000
(12:42 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 18 Mar 2007 22:36:59 +0000
(15:36 -0700)
This doesn't change any code, it just creates a point for where we'd
actually do the caching of delta bases that have been generated.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_file.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
5bb44a5
)
diff --git
a/sha1_file.c
b/sha1_file.c
index 110d696213323407616c3ed2417ebf7448a623c1..f11ca3fbacd5de159129c3311d7915d56aff79e4 100644
(file)
--- a/
sha1_file.c
+++ b/
sha1_file.c
@@
-1352,6
+1352,18
@@
static void *unpack_compressed_entry(struct packed_git *p,
return buffer;
}
return buffer;
}
+static void *cache_or_unpack_entry(struct packed_git *p, off_t base_offset,
+ unsigned long *base_size, enum object_type *type)
+{
+ return unpack_entry(p, base_offset, type, base_size);
+}
+
+static void add_delta_base_cache(struct packed_git *p, off_t base_offset,
+ void *base, unsigned long base_size, enum object_type type)
+{
+ free(base);
+}
+
static void *unpack_delta_entry(struct packed_git *p,
struct pack_window **w_curs,
off_t curpos,
static void *unpack_delta_entry(struct packed_git *p,
struct pack_window **w_curs,
off_t curpos,
@@
-1365,7
+1377,7
@@
static void *unpack_delta_entry(struct packed_git *p,
off_t base_offset;
base_offset = get_delta_base(p, w_curs, &curpos, *type, obj_offset);
off_t base_offset;
base_offset = get_delta_base(p, w_curs, &curpos, *type, obj_offset);
- base =
unpack_entry(p, base_offset, type, &base_siz
e);
+ base =
cache_or_unpack_entry(p, base_offset, &base_size, typ
e);
if (!base)
die("failed to read delta base object"
" at %"PRIuMAX" from %s",
if (!base)
die("failed to read delta base object"
" at %"PRIuMAX" from %s",
@@
-1378,7
+1390,7
@@
static void *unpack_delta_entry(struct packed_git *p,
if (!result)
die("failed to apply delta");
free(delta_data);
if (!result)
die("failed to apply delta");
free(delta_data);
-
free(bas
e);
+
add_delta_base_cache(p, base_offset, base, base_size, *typ
e);
return result;
}
return result;
}