]> git.ipfire.org Git - thirdparty/git.git/blobdiff - packfile.c
test-ref-store: remove force-create argument for create-reflog
[thirdparty/git.git] / packfile.c
index 89402cfc69cd0f03b268f26bd6c8c7ad459b3e1b..6423d77faad46cef05497a3e2750726623318e22 100644 (file)
@@ -1060,7 +1060,7 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
                unsigned long len, enum object_type *type, unsigned long *sizep)
 {
        unsigned shift;
-       unsigned long size, c;
+       size_t size, c;
        unsigned long used = 0;
 
        c = buf[used++];
@@ -1074,10 +1074,10 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
                        break;
                }
                c = buf[used++];
-               size += (c & 0x7f) << shift;
+               size = st_add(size, st_left_shift(c & 0x7f, shift));
                shift += 7;
        }
-       *sizep = size;
+       *sizep = cast_size_t_to_ulong(size);
        return used;
 }