diff options
author | Carlos Martín Nieto <cmn@elego.de> | 2012-06-28 11:33:08 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@elego.de> | 2012-06-28 12:24:03 +0400 |
commit | 371599576a82b43ab30fe66feadcfb3045e649ff (patch) | |
tree | e08bb3bff814fe9614d607c0c03a4e562ec3ebdb /src/fetch.c | |
parent | ed754a75e145352c02da62b5d56df5866d7eec26 (diff) |
indexer: don't use '/objects/pack/' unconditionally
Not everyone who indexes a packfile wants to put it in the standard
git repository location.
Diffstat (limited to 'src/fetch.c')
-rw-r--r-- | src/fetch.c | 9 |
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; } |