aboutsummaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorAndreas Köhler <andi5.py@gmx.net>2010-10-08 03:07:48 +0200
committerJunio C Hamano <gitster@pobox.com>2010-10-13 18:31:45 -0700
commit33f072f8910081b12780197a2a5423227e437af8 (patch)
treeabfa4e5e3842c55dde210c298c613ae92dcf90cf /git-submodule.sh
parent7c6eafa35af805578990e76b691ff7f1a25a3c57 (diff)
downloadgit-33f072f8910081b12780197a2a5423227e437af8.tar.gz
git-33f072f8910081b12780197a2a5423227e437af8.tar.xz
submodule sync: Update "submodule.<name>.url" for empty directories
If a submodule directory has not been filled by "git submodule update" yet, then "git submodule sync" must still update the super-project's configuration for submodule.<name>.url. This situation occurs when switching between branches with a module from different urls and other branches without the submodule. Signed-off-by: Andreas Köhler <andi5.py@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 9ebbab798..c291eed59 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -836,11 +836,12 @@ cmd_sync()
;;
esac
+ say "Synchronizing submodule url for '$name'"
+ git config submodule."$name".url "$url"
+
if test -e "$path"/.git
then
(
- say "Synchronizing submodule url for '$name'"
- git config submodule."$name".url "$url"
clear_local_git_env
cd "$path"
remote=$(get_default_remote)