@@ -118,10 +118,11 @@ static int resolve_relative_url_test(int argc, const char **argv, const char *pr
118
118
return 0 ;
119
119
}
120
120
121
- static char * do_get_submodule_displaypath (const char * path ,
122
- const char * prefix ,
123
- const char * super_prefix )
121
+ /* the result should be freed by the caller. */
122
+ static char * get_submodule_displaypath (const char * path , const char * prefix )
124
123
{
124
+ const char * super_prefix = get_super_prefix ();
125
+
125
126
if (prefix && super_prefix ) {
126
127
BUG ("cannot have prefix '%s' and superprefix '%s'" ,
127
128
prefix , super_prefix );
@@ -137,13 +138,6 @@ static char *do_get_submodule_displaypath(const char *path,
137
138
}
138
139
}
139
140
140
- /* the result should be freed by the caller. */
141
- static char * get_submodule_displaypath (const char * path , const char * prefix )
142
- {
143
- const char * super_prefix = get_super_prefix ();
144
- return do_get_submodule_displaypath (path , prefix , super_prefix );
145
- }
146
-
147
141
static char * compute_rev_name (const char * sub_path , const char * object_id )
148
142
{
149
143
struct strbuf sb = STRBUF_INIT ;
@@ -488,7 +482,7 @@ static void init_submodule(const char *path, const char *prefix,
488
482
struct strbuf sb = STRBUF_INIT ;
489
483
char * upd = NULL , * url = NULL , * displaypath ;
490
484
491
- displaypath = do_get_submodule_displaypath (path , prefix , get_super_prefix () );
485
+ displaypath = get_submodule_displaypath (path , prefix );
492
486
493
487
sub = submodule_from_path (the_repository , null_oid (), path );
494
488
@@ -1943,8 +1937,7 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
1943
1937
enum submodule_update_type update_type ;
1944
1938
char * key ;
1945
1939
struct update_data * ud = suc -> update_data ;
1946
- char * displaypath = do_get_submodule_displaypath (ce -> name , ud -> prefix ,
1947
- get_super_prefix ());
1940
+ char * displaypath = get_submodule_displaypath (ce -> name , ud -> prefix );
1948
1941
struct strbuf sb = STRBUF_INIT ;
1949
1942
int needs_cloning = 0 ;
1950
1943
int need_free_url = 0 ;
@@ -2461,9 +2454,8 @@ static int update_submodule(struct update_data *update_data)
2461
2454
{
2462
2455
ensure_core_worktree (update_data -> sm_path );
2463
2456
2464
- update_data -> displaypath = do_get_submodule_displaypath (update_data -> sm_path ,
2465
- update_data -> prefix ,
2466
- get_super_prefix ());
2457
+ update_data -> displaypath = get_submodule_displaypath (
2458
+ update_data -> sm_path , update_data -> prefix );
2467
2459
2468
2460
determine_submodule_update_strategy (the_repository , update_data -> just_cloned ,
2469
2461
update_data -> sm_path , update_data -> update_default ,
0 commit comments