File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -836,11 +836,12 @@ cmd_sync()
836
836
;;
837
837
esac
838
838
839
+ say " Synchronizing submodule url for '$name '"
840
+ git config submodule." $name " .url " $url "
841
+
839
842
if test -e " $path " /.git
840
843
then
841
844
(
842
- say " Synchronizing submodule url for '$name '"
843
- git config submodule." $name " .url " $url "
844
845
clear_local_git_env
845
846
cd " $path "
846
847
remote=$( get_default_remote)
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ test_expect_success setup '
23
23
git commit -m "submodule"
24
24
) &&
25
25
git clone super super-clone &&
26
- (cd super-clone && git submodule update --init)
26
+ (cd super-clone && git submodule update --init) &&
27
+ git clone super empty-clone &&
28
+ (cd empty-clone && git submodule init)
27
29
'
28
30
29
31
test_expect_success ' change submodule' '
@@ -64,4 +66,12 @@ test_expect_success '"git submodule sync" should update submodule URLs' '
64
66
)
65
67
'
66
68
69
+ test_expect_success ' "git submodule sync" should update submodule URLs if not yet cloned' '
70
+ (cd empty-clone &&
71
+ git pull &&
72
+ git submodule sync &&
73
+ test -d "$(git config submodule.submodule.url)"
74
+ )
75
+ '
76
+
67
77
test_done
You can’t perform that action at this time.
0 commit comments