File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 12
12
#include "packfile.h"
13
13
#include "object-store.h"
14
14
#include "repository.h"
15
+ #include "submodule.h"
15
16
#include "midx.h"
16
17
#include "commit-reach.h"
17
18
@@ -1797,7 +1798,7 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo,
1797
1798
oc -> path = xstrdup (cp );
1798
1799
1799
1800
if (!repo -> index -> cache )
1800
- repo_read_index (the_repository );
1801
+ repo_read_index (repo );
1801
1802
pos = index_name_pos (repo -> index , cp , namelen );
1802
1803
if (pos < 0 )
1803
1804
pos = - pos - 1 ;
@@ -1842,6 +1843,14 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo,
1842
1843
new_filename = resolve_relative_path (repo , filename );
1843
1844
if (new_filename )
1844
1845
filename = new_filename ;
1846
+ /*
1847
+ * NEEDSWORK: Eventually get_tree_entry*() should
1848
+ * learn to take struct repository directly and we
1849
+ * would not need to inject submodule odb to the
1850
+ * in-core odb.
1851
+ */
1852
+ if (repo != the_repository )
1853
+ add_to_alternates_memory (repo -> objects -> odb -> path );
1845
1854
if (flags & GET_OID_FOLLOW_SYMLINKS ) {
1846
1855
ret = get_tree_entry_follow_symlinks (& tree_oid ,
1847
1856
filename , oid , & oc -> symlink_path ,
You can’t perform that action at this time.
0 commit comments