Skip to content

Commit

Permalink
Merge branch 'jk/initialization-fix-to-add-submodule-odb'
Browse files Browse the repository at this point in the history
We peek objects from submodule's object store by linking it to the
list of alternate object databases, but the code to do so forgot to
correctly initialize the list.

* jk/initialization-fix-to-add-submodule-odb:
  add_submodule_odb: initialize alt_odb list earlier
  • Loading branch information
Junio C Hamano committed Nov 3, 2015
2 parents c253b82 + 9a6e4f0 commit acfeaf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion submodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static int add_submodule_odb(const char *path)
goto done;
}
/* avoid adding it twice */
prepare_alt_odb();
for (alt_odb = alt_odb_list; alt_odb; alt_odb = alt_odb->next)
if (alt_odb->name - alt_odb->base == objects_directory.len &&
!strncmp(alt_odb->base, objects_directory.buf,
Expand All @@ -148,7 +149,6 @@ static int add_submodule_odb(const char *path)

/* add possible alternates from the submodule */
read_info_alternates(objects_directory.buf, 0);
prepare_alt_odb();
done:
strbuf_release(&objects_directory);
return ret;
Expand Down

0 comments on commit acfeaf8

Please sign in to comment.