@@ -96,7 +96,7 @@ int update_path_in_gitmodules(const char *oldpath, const char *newpath)
96
96
if (is_gitmodules_unmerged (& the_index ))
97
97
die (_ ("Cannot change unmerged .gitmodules, resolve merge conflicts first" ));
98
98
99
- submodule = submodule_from_path (& null_oid , oldpath );
99
+ submodule = submodule_from_path (the_repository , & null_oid , oldpath );
100
100
if (!submodule || !submodule -> name ) {
101
101
warning (_ ("Could not find section in .gitmodules where path=%s" ), oldpath );
102
102
return -1 ;
@@ -130,7 +130,7 @@ int remove_path_from_gitmodules(const char *path)
130
130
if (is_gitmodules_unmerged (& the_index ))
131
131
die (_ ("Cannot change unmerged .gitmodules, resolve merge conflicts first" ));
132
132
133
- submodule = submodule_from_path (& null_oid , path );
133
+ submodule = submodule_from_path (the_repository , & null_oid , path );
134
134
if (!submodule || !submodule -> name ) {
135
135
warning (_ ("Could not find section in .gitmodules where path=%s" ), path );
136
136
return -1 ;
@@ -174,7 +174,8 @@ static int add_submodule_odb(const char *path)
174
174
void set_diffopt_flags_from_submodule_config (struct diff_options * diffopt ,
175
175
const char * path )
176
176
{
177
- const struct submodule * submodule = submodule_from_path (& null_oid , path );
177
+ const struct submodule * submodule = submodule_from_path (the_repository ,
178
+ & null_oid , path );
178
179
if (submodule ) {
179
180
const char * ignore ;
180
181
char * key ;
@@ -674,7 +675,7 @@ const struct submodule *submodule_from_ce(const struct cache_entry *ce)
674
675
if (!should_update_submodules ())
675
676
return NULL ;
676
677
677
- return submodule_from_path (& null_oid , ce -> name );
678
+ return submodule_from_path (the_repository , & null_oid , ce -> name );
678
679
}
679
680
680
681
static struct oid_array * submodule_commits (struct string_list * submodules ,
@@ -731,13 +732,14 @@ static void collect_changed_submodules_cb(struct diff_queue_struct *q,
731
732
if (!S_ISGITLINK (p -> two -> mode ))
732
733
continue ;
733
734
734
- submodule = submodule_from_path (commit_oid , p -> two -> path );
735
+ submodule = submodule_from_path (the_repository ,
736
+ commit_oid , p -> two -> path );
735
737
if (submodule )
736
738
name = submodule -> name ;
737
739
else {
738
740
name = default_name_or_path (p -> two -> path );
739
741
/* make sure name does not collide with existing one */
740
- submodule = submodule_from_name (commit_oid , name );
742
+ submodule = submodule_from_name (the_repository , commit_oid , name );
741
743
if (submodule ) {
742
744
warning ("Submodule in commit %s at path: "
743
745
"'%s' collides with a submodule named "
@@ -945,7 +947,7 @@ int find_unpushed_submodules(struct oid_array *commits,
945
947
const struct submodule * submodule ;
946
948
const char * path = NULL ;
947
949
948
- submodule = submodule_from_name (& null_oid , name -> string );
950
+ submodule = submodule_from_name (the_repository , & null_oid , name -> string );
949
951
if (submodule )
950
952
path = submodule -> path ;
951
953
else
@@ -1113,7 +1115,7 @@ static void calculate_changed_submodule_paths(void)
1113
1115
const struct string_list_item * name ;
1114
1116
1115
1117
/* No need to check if there are no submodules configured */
1116
- if (!submodule_from_path (NULL , NULL ))
1118
+ if (!submodule_from_path (the_repository , NULL , NULL ))
1117
1119
return ;
1118
1120
1119
1121
argv_array_push (& argv , "--" ); /* argv[0] program name */
@@ -1134,7 +1136,7 @@ static void calculate_changed_submodule_paths(void)
1134
1136
const struct submodule * submodule ;
1135
1137
const char * path = NULL ;
1136
1138
1137
- submodule = submodule_from_name (& null_oid , name -> string );
1139
+ submodule = submodule_from_name (the_repository , & null_oid , name -> string );
1138
1140
if (submodule )
1139
1141
path = submodule -> path ;
1140
1142
else
@@ -1162,7 +1164,7 @@ int submodule_touches_in_range(struct object_id *excl_oid,
1162
1164
int ret ;
1163
1165
1164
1166
/* No need to check if there are no submodules configured */
1165
- if (!submodule_from_path (NULL , NULL ))
1167
+ if (!submodule_from_path (the_repository , NULL , NULL ))
1166
1168
return 0 ;
1167
1169
1168
1170
argv_array_push (& args , "--" ); /* args[0] program name */
@@ -1604,7 +1606,7 @@ int submodule_move_head(const char *path,
1604
1606
if (old && !is_submodule_populated_gently (path , error_code_ptr ))
1605
1607
return 0 ;
1606
1608
1607
- sub = submodule_from_path (& null_oid , path );
1609
+ sub = submodule_from_path (the_repository , & null_oid , path );
1608
1610
1609
1611
if (!sub )
1610
1612
die ("BUG: could not get submodule information for '%s'" , path );
@@ -1886,7 +1888,7 @@ static void relocate_single_git_dir_into_superproject(const char *prefix,
1886
1888
1887
1889
real_old_git_dir = real_pathdup (old_git_dir , 1 );
1888
1890
1889
- sub = submodule_from_path (& null_oid , path );
1891
+ sub = submodule_from_path (the_repository , & null_oid , path );
1890
1892
if (!sub )
1891
1893
die (_ ("could not lookup name for submodule '%s'" ), path );
1892
1894
@@ -1942,7 +1944,7 @@ void absorb_git_dir_into_superproject(const char *prefix,
1942
1944
* superproject did not rewrite the git file links yet,
1943
1945
* fix it now.
1944
1946
*/
1945
- sub = submodule_from_path (& null_oid , path );
1947
+ sub = submodule_from_path (the_repository , & null_oid , path );
1946
1948
if (!sub )
1947
1949
die (_ ("could not lookup name for submodule '%s'" ), path );
1948
1950
connect_work_tree_and_git_dir (path ,
@@ -2088,7 +2090,7 @@ int submodule_to_gitdir(struct strbuf *buf, const char *submodule)
2088
2090
strbuf_addstr (buf , git_dir );
2089
2091
}
2090
2092
if (!is_git_directory (buf -> buf )) {
2091
- sub = submodule_from_path (& null_oid , submodule );
2093
+ sub = submodule_from_path (the_repository , & null_oid , submodule );
2092
2094
if (!sub ) {
2093
2095
ret = -1 ;
2094
2096
goto cleanup ;
0 commit comments