summaryrefslogtreecommitdiff
path: root/src/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fetch.c')
-rw-r--r--src/fetch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fetch.c b/src/fetch.c
index 96b263faa..603284842 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -118,7 +118,8 @@ int git_fetch__download_pack(
int recvd;
char buff[1024];
gitno_buffer buf;
- git_indexer_stream *idx;
+ git_buf path = GIT_BUF_INIT;
+ git_indexer_stream *idx = NULL;
gitno_buffer_setup(t, &buf, buff, sizeof(buff));
@@ -127,9 +128,12 @@ int git_fetch__download_pack(
return -1;
}
- if (git_indexer_stream_new(&idx, git_repository_path(repo)) < 0)
+ if (git_buf_joinpath(&path, git_repository_path(repo), "objects/pack") < 0)
return -1;
+ if (git_indexer_stream_new(&idx, git_buf_cstr(&path)) < 0)
+ goto on_error;
+
memset(stats, 0, sizeof(git_indexer_stats));
if (git_indexer_stream_add(idx, buffered, buffered_size, stats) < 0)
goto on_error;
@@ -154,6 +158,7 @@ int git_fetch__download_pack(
return 0;
on_error:
+ git_buf_free(&path);
git_indexer_stream_free(idx);
return -1;
}