Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
 builtin/pack-objects.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 9613732..fb2394d 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1329,7 +1329,8 @@ static void check_object(struct object_entry *entry)
                        break;
                }
 
-               if (base_ref && (base_entry = locate_object_entry(base_ref))) {
+               if (base_ref && (base_entry = locate_object_entry(base_ref)) &&
+                   (pack_version < 4 || entry->type != OBJ_COMMIT)) {
                        /*
                         * If base_ref was set above that means we wish to
                         * reuse delta data, and we even found that base
@@ -1413,6 +1414,8 @@ static void get_object_details(void)
                check_object(entry);
                if (big_file_threshold < entry->size)
                        entry->no_try_delta = 1;
+               if (pack_version == 4 && entry->type == OBJ_COMMIT)
+                       entry->no_try_delta = 1;
        }
 
        free(sorted_by_offset);
-- 
1.8.2.83.gc99314b

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to