@@ -1687,8 +1687,6 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
1687
1687
task = get_fetch_task_from_changed (spf , err );
1688
1688
1689
1689
if (task ) {
1690
- struct strbuf submodule_prefix = STRBUF_INIT ;
1691
-
1692
1690
child_process_init (cp );
1693
1691
cp -> dir = task -> repo -> gitdir ;
1694
1692
prepare_submodule_repo_env_in_gitdir (& cp -> env );
@@ -1698,28 +1696,20 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
1698
1696
strvec_pushv (& cp -> args , task -> git_args .v );
1699
1697
strvec_pushv (& cp -> args , spf -> args .v );
1700
1698
strvec_push (& cp -> args , task -> default_argv );
1701
- strvec_push (& cp -> args , "--submodule-prefix" );
1699
+ strvec_pushf (& cp -> args , "--submodule-prefix=%s%s/" ,
1700
+ spf -> prefix , task -> sub -> path );
1702
1701
1703
- strbuf_addf (& submodule_prefix , "%s%s/" ,
1704
- spf -> prefix ,
1705
- task -> sub -> path );
1706
- strvec_push (& cp -> args , submodule_prefix .buf );
1707
1702
* task_cb = task ;
1708
1703
1709
- strbuf_release (& submodule_prefix );
1710
1704
string_list_insert (& spf -> seen_submodule_names , task -> sub -> name );
1711
1705
return 1 ;
1712
1706
}
1713
1707
1714
1708
if (spf -> oid_fetch_tasks_nr ) {
1715
1709
struct fetch_task * task =
1716
1710
spf -> oid_fetch_tasks [spf -> oid_fetch_tasks_nr - 1 ];
1717
- struct strbuf submodule_prefix = STRBUF_INIT ;
1718
1711
spf -> oid_fetch_tasks_nr -- ;
1719
1712
1720
- strbuf_addf (& submodule_prefix , "%s%s/" ,
1721
- spf -> prefix , task -> sub -> path );
1722
-
1723
1713
child_process_init (cp );
1724
1714
prepare_submodule_repo_env_in_gitdir (& cp -> env );
1725
1715
cp -> git_cmd = 1 ;
@@ -1728,16 +1718,15 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
1728
1718
strvec_init (& cp -> args );
1729
1719
strvec_pushv (& cp -> args , spf -> args .v );
1730
1720
strvec_push (& cp -> args , "on-demand" );
1731
- strvec_push (& cp -> args , "--submodule-prefix" );
1732
- strvec_push ( & cp -> args , submodule_prefix . buf );
1721
+ strvec_pushf (& cp -> args , "--submodule-prefix=%s%s/" ,
1722
+ spf -> prefix , task -> sub -> path );
1733
1723
1734
1724
/* NEEDSWORK: have get_default_remote from submodule--helper */
1735
1725
strvec_push (& cp -> args , "origin" );
1736
1726
oid_array_for_each_unique (task -> commits ,
1737
1727
append_oid_to_argv , & cp -> args );
1738
1728
1739
1729
* task_cb = task ;
1740
- strbuf_release (& submodule_prefix );
1741
1730
return 1 ;
1742
1731
}
1743
1732
0 commit comments