diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2013-10-11 17:24:29 +0200 | 
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-10-11 17:26:20 +0200 | 
| commit | 893055f22e5395ec95231b4cc8a19046a3eb5b4a (patch) | |
| tree | 11bfecd3bd17817388d1381fd67abebe0b2fd950 /src | |
| parent | 7fb6eb278b350f9f4caab5a3f72bfb70353fc40d (diff) | |
| download | libgit2-893055f22e5395ec95231b4cc8a19046a3eb5b4a.tar.gz | |
indexer: clearer stats for thin packs
Don't increase the number of total objects, as it can produce
suprising progress output. The only addition compared to pre-thin is
the addition of local_objects to allow an output similar to git's
"completed with %d local objects".
Diffstat (limited to 'src')
| -rw-r--r-- | src/indexer.c | 5 | 
1 files changed, 2 insertions, 3 deletions
diff --git a/src/indexer.c b/src/indexer.c index 2cda1a629..93ad116fe 100644 --- a/src/indexer.c +++ b/src/indexer.c @@ -733,7 +733,6 @@ static int fix_thin_pack(git_indexer_stream *idx, git_transfer_progress *stats)  	if (inject_object(idx, &base) < 0)  		return -1; -	stats->total_objects++;  	stats->local_objects++;  	return 0; @@ -798,7 +797,7 @@ static int update_header_and_rehash(git_indexer_stream *idx, git_transfer_progre  	git_mwindow_free_all(mwf);  	/* Update the header to include the numer of local objects we injected */ -	idx->hdr.hdr_entries = htonl(stats->total_objects); +	idx->hdr.hdr_entries = htonl(stats->total_objects + stats->local_objects);  	if (p_lseek(idx->pack_file.fd, 0, SEEK_SET) < 0) {  		giterr_set(GITERR_OS, "failed to seek to the beginning of the pack");  		return -1; @@ -870,7 +869,7 @@ int git_indexer_stream_finalize(git_indexer_stream *idx, git_transfer_progress *  	if (resolve_deltas(idx, stats) < 0)  		return -1; -	if (stats->indexed_objects + stats->local_objects != stats->total_objects) { +	if (stats->indexed_objects != stats->total_objects) {  		giterr_set(GITERR_INDEXER, "early EOF");  		return -1;  	}  | 
