summaryrefslogtreecommitdiff
path: root/src/odb_loose.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-12 13:06:33 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-13 09:34:20 +0200
commit77b339f7b6c7e167ecaf9374eb6876b498d8cb83 (patch)
tree2067451017501f2d2411442370a71997c715e52b /src/odb_loose.c
parentf85a9c2767b43f35904bf39858488a4b7bc304e8 (diff)
downloadlibgit2-cmn/stream-size.tar.gz
odb: make the writestream's size a git_off_tcmn/stream-size
Restricting files to size_t is a silly limitation. The loose backend writes to a file directly, so there is no issue in using 63 bits for the size. We still assume that the header is going to fit in 64 bytes, which does mean quite a bit smaller files due to the run-length encoding, but it's still a much larger size than you would want Git to handle.
Diffstat (limited to 'src/odb_loose.c')
-rw-r--r--src/odb_loose.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/odb_loose.c b/src/odb_loose.c
index bfd95588b..99b8f7c91 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -834,7 +834,7 @@ static void loose_backend__stream_free(git_odb_stream *_stream)
git__free(stream);
}
-static int loose_backend__stream(git_odb_stream **stream_out, git_odb_backend *_backend, size_t length, git_otype type)
+static int loose_backend__stream(git_odb_stream **stream_out, git_odb_backend *_backend, git_off_t length, git_otype type)
{
loose_backend *backend;
loose_writestream *stream = NULL;
@@ -842,7 +842,7 @@ static int loose_backend__stream(git_odb_stream **stream_out, git_odb_backend *_
git_buf tmp_path = GIT_BUF_INIT;
int hdrlen;
- assert(_backend);
+ assert(_backend && length >= 0);
backend = (loose_backend *)_backend;
*stream_out = NULL;