summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-02 15:34:44 -0800
committerJunio C Hamano <gitster@pobox.com>2013-12-02 15:34:44 -0800
commitbe38bee862d628e29043b3f680580ceb24a6ba1e (patch)
treed848f433968754e5e9d1e6231614ab8db7cf31dc /git-submodule.sh
parentd2446dfd7f3b3f8948142cfb07a0270e2497d93f (diff)
parent2f93541d88fadd1ff5307d81c2c8921ee3eea058 (diff)
downloadgit-be38bee862d628e29043b3f680580ceb24a6ba1e.tar.gz
Sync with 1.8.4.5
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 896f1c9b82..66f5f752c5 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -612,11 +612,21 @@ cmd_init()
fi
# Copy "update" setting when it is not set yet
- upd="$(git config -f .gitmodules submodule."$name".update)"
- test -z "$upd" ||
- test -n "$(git config submodule."$name".update)" ||
- git config submodule."$name".update "$upd" ||
- die "$(eval_gettext "Failed to register update mode for submodule path '\$displaypath'")"
+ if upd="$(git config -f .gitmodules submodule."$name".update)" &&
+ test -n "$upd" &&
+ test -z "$(git config submodule."$name".update)"
+ then
+ case "$upd" in
+ rebase | merge | none)
+ ;; # known modes of updating
+ *)
+ echo >&2 "warning: unknown update mode '$upd' suggested for submodule '$name'"
+ upd=none
+ ;;
+ esac
+ git config submodule."$name".update "$upd" ||
+ die "$(eval_gettext "Failed to register update mode for submodule path '\$displaypath'")"
+ fi
done
}