]> git.proxmox.com Git - libgit2.git/commitdiff
indexer: start parsing input data immediately
authorMichael Schubert <schu@schu.io>
Mon, 25 Jun 2012 13:26:38 +0000 (15:26 +0200)
committerMichael Schubert <schu@schu.io>
Mon, 25 Jun 2012 13:38:36 +0000 (15:38 +0200)
Currently, the first call of git_indexer_stream_add adds the data to the
underlying pack file and opens it for later use, but doesn't start
parsing the already available data.
This means, git_indexer_stream_finalize only works if
git_indexer_stream_add was called at least twice. Kill this limitation
by parsing available data immediately.

src/indexer.c

index 565d9ea0e2629ae0f563c13e3dbd9f51ff789c22..1b0a2032100b78b9dac39ccb2e38d462a59e5ef7 100644 (file)
@@ -313,8 +313,6 @@ int git_indexer_stream_add(git_indexer_stream *idx, const void *data, size_t siz
                mwf = &idx->pack->mwf;
                if (git_mwindow_file_register(&idx->pack->mwf) < 0)
                        return -1;
-
-               return 0;
        }
 
        if (!idx->parsed_header) {