From: Junio C Hamano Date: Fri, 22 Jul 2011 21:24:35 +0000 (-0700) Subject: Merge branch 'jl/submodule-add-relurl-wo-upstream' X-Git-Tag: v1.7.7-rc0~82 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c56dce3b811400e73e7b68464cf229aa0edb9d8f;p=git.git Merge branch 'jl/submodule-add-relurl-wo-upstream' * jl/submodule-add-relurl-wo-upstream: submodule add: clean up duplicated code submodule add: allow relative repository path even when no url is set submodule add: test failure when url is not configured in superproject Conflicts: git-submodule.sh --- c56dce3b811400e73e7b68464cf229aa0edb9d8f diff --cc git-submodule.sh index 3daa0c834,32cb05443..bc1d3fa66 --- a/git-submodule.sh +++ b/git-submodule.sh @@@ -237,19 -233,12 +237,11 @@@ Use -f if you really want to add it." & then if test -d "$path"/.git -o -f "$path"/.git then - echo "Adding existing repo at '$path' to the index" + eval_gettext "Adding existing repo at '\$path' to the index"; echo else - die "'$path' already exists and is not a valid git repo" + die "$(eval_gettext "'\$path' already exists and is not a valid git repo")" fi - case "$repo" in - ./*|../*) - url=$(resolve_relative_url "$repo") || exit - ;; - *) - url="$repo" - ;; - esac - git config submodule."$path".url "$realrepo" else module_clone "$path" "$realrepo" "$reference" || exit @@@ -261,12 -250,11 +253,12 @@@ '') git checkout -f -q ;; ?*) git checkout -f -q -B "$branch" "origin/$branch" ;; esac - ) || die "Unable to checkout submodule '$path'" + ) || die "$(eval_gettext "Unable to checkout submodule '\$path'")" fi - git config submodule."$path".url "$url" ++ git config submodule."$path".url "$realrepo" git add $force "$path" || - die "Failed to add submodule '$path'" + die "$(eval_gettext "Failed to add submodule '\$path'")" git config -f .gitmodules submodule."$path".path "$path" && git config -f .gitmodules submodule."$path".url "$repo" &&