summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f7932a)
raw | patch | inline | side by side (parent: 7f7932a)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 2 Apr 2007 22:06:59 +0000 (15:06 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 4 Apr 2007 07:19:28 +0000 (00:19 -0700) |
This variable keeps track of which entry in the original index
the traversal is looking at, and belongs to the unpack_trees_options
structure along with other traversal status information.
Signed-off-by: Junio C Hamano <junkio@cox.net>
the traversal is looking at, and belongs to the unpack_trees_options
structure along with other traversal status information.
Signed-off-by: Junio C Hamano <junkio@cox.net>
unpack-trees.c | patch | blob | history | |
unpack-trees.h | patch | blob | history |
diff --git a/unpack-trees.c b/unpack-trees.c
index 9c0f4d7651f69832c6a5ec363f4fd76be93acf36..4cf83bd90a0d005f481752ef00db76668587bb50 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
static int unpack_trees_rec(struct tree_entry_list **posns, int len,
const char *base, struct unpack_trees_options *o,
- int *indpos,
struct tree_entry_list *df_conflict_list)
{
int baselen = strlen(base);
cache_name = NULL;
/* Check the cache */
- if (o->merge && *indpos < active_nr) {
+ if (o->merge && o->pos < active_nr) {
/* This is a bit tricky: */
/* If the index has a subdirectory (with
* contents) as the first name, it'll get a
* file case.
*/
- cache_name = active_cache[*indpos]->name;
+ cache_name = active_cache[o->pos]->name;
if (strlen(cache_name) > baselen &&
!memcmp(cache_name, base, baselen)) {
cache_name += baselen;
if (cache_name && !strcmp(cache_name, first)) {
any_files = 1;
- src[0] = active_cache[*indpos];
- remove_cache_entry_at(*indpos);
+ src[0] = active_cache[o->pos];
+ remove_cache_entry_at(o->pos);
}
for (i = 0; i < len; i++) {
#if DBRT_DEBUG > 1
printf("Added %d entries\n", ret);
#endif
- *indpos += ret;
+ o->pos += ret;
} else {
for (i = 0; i < src_size; i++) {
if (src[i]) {
newbase[baselen + pathlen] = '/';
newbase[baselen + pathlen + 1] = '\0';
if (unpack_trees_rec(subposns, len, newbase, o,
- indpos, df_conflict_list)) {
+ df_conflict_list)) {
retval = -1;
goto leave_directory;
}
int unpack_trees(struct object_list *trees, struct unpack_trees_options *o)
{
- int indpos = 0;
unsigned len = object_list_length(trees);
struct tree_entry_list **posns;
int i;
posn = posn->next;
}
if (unpack_trees_rec(posns, len, o->prefix ? o->prefix : "",
- o, &indpos, &df_conflict_list))
+ o, &df_conflict_list))
return -1;
}
diff --git a/unpack-trees.h b/unpack-trees.h
index 191f7442f10683c8043288eece36f39166fedc95..fee7da43822b63e5b1f24444e5c51c43d3ff5760 100644 (file)
--- a/unpack-trees.h
+++ b/unpack-trees.h
int verbose_update;
int aggressive;
const char *prefix;
+ int pos;
struct dir_struct *dir;
merge_fn_t fn;