| 688 | } |
| 689 | |
| 690 | static int in_window(struct repository *r, struct pack_window *win, |
| 691 | off_t offset) |
| 692 | { |
| 693 | /* We must promise at least one full hash after the |
| 694 | * offset is available from this window, otherwise the offset |
| 695 | * is not actually in this window and a different window (which |
| 696 | * has that one hash excess) must be used. This is to support |
| 697 | * the object header and delta base parsing routines below. |
| 698 | */ |
| 699 | off_t win_off = win->offset; |
| 700 | return win_off <= offset |
| 701 | && (offset + r->hash_algo->rawsz) <= (win_off + win->len); |
| 702 | } |
| 703 | |
| 704 | unsigned char *use_pack(struct packed_git *p, |
| 705 | struct pack_window **w_cursor, |