Signed-off-by: Christian Couder <[email protected]>
---
odb-helper.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/odb-helper.c b/odb-helper.c
index 910c87a482..0017faa36e 100644
--- a/odb-helper.c
+++ b/odb-helper.c
@@ -584,15 +584,19 @@ int odb_helper_fetch_object(struct odb_helper *o,
const unsigned char *sha1,
int fd)
{
- switch(o->fetch_kind) {
- case ODB_FETCH_KIND_PLAIN_OBJECT:
- return odb_helper_fetch_plain_object(o, sha1, fd);
- case ODB_FETCH_KIND_GIT_OBJECT:
- return odb_helper_fetch_git_object(o, sha1, fd);
- case ODB_FETCH_KIND_FAULT_IN:
- return 0;
- default:
- BUG("invalid fetch kind '%d'", o->fetch_kind);
+ if (o->script_mode) {
+ switch(o->fetch_kind) {
+ case ODB_FETCH_KIND_PLAIN_OBJECT:
+ return odb_helper_fetch_plain_object(o, sha1, fd);
+ case ODB_FETCH_KIND_GIT_OBJECT:
+ return odb_helper_fetch_git_object(o, sha1, fd);
+ case ODB_FETCH_KIND_FAULT_IN:
+ return 0;
+ default:
+ BUG("invalid fetch kind '%d'", o->fetch_kind);
+ }
+ } else {
+ return read_object_process(o, sha1, fd);
}
}
--
2.13.1.565.gbfcd7a9048