Staging
v0.5.1
https://github.com/git/git
Revision 1164f1e48d7c8ed613e8a371ecfce27220606e09 authored by Linus Torvalds on 26 June 2007, 21:34:02 UTC, committed by Junio C Hamano on 27 June 2007, 01:02:15 UTC
A pack-file can get created without any objects in it (to transfer "no
data" - which can happen if you use a reference git repo, for example,
or just otherwise just end up transferring only branch head information
and already have all the objects themselves).

And while we probably should never create an index for such a pack, if we
do (and we do), the index file size sanity checking was incorrect.

This fixes it.

Reported-and-tested-by: Jocke Tjernlund <tjernlund@tjernlund.se>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 582c739
Raw File
Tip revision: 1164f1e48d7c8ed613e8a371ecfce27220606e09 authored by Linus Torvalds on 26 June 2007, 21:34:02 UTC
Fix zero-object version-2 packs
Tip revision: 1164f1e
unpack-trees.h
#ifndef UNPACK_TREES_H
#define UNPACK_TREES_H

struct unpack_trees_options;

typedef int (*merge_fn_t)(struct cache_entry **src,
		struct unpack_trees_options *options);

struct unpack_trees_options {
	int reset;
	int merge;
	int update;
	int index_only;
	int nontrivial_merge;
	int trivial_merges_only;
	int verbose_update;
	int aggressive;
	const char *prefix;
	int pos;
	struct dir_struct *dir;
	merge_fn_t fn;

	int head_idx;
	int merge_size;

	struct cache_entry *df_conflict_entry;
};

extern int unpack_trees(struct object_list *trees,
		struct unpack_trees_options *options);

int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);

#endif
back to top