diff --git a/git-submodule.sh b/git-submodule.sh
index 20c9bec9709749239849e5e91df2a9ac40c77eae..c94218b8779be63e1441480ef3828fb4ce0b61b0 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
{
remote=$(get_default_remote)
remoteurl=$(git config "remote.$remote.url") ||
{
remote=$(get_default_remote)
remoteurl=$(git config "remote.$remote.url") ||
- die "remote ($remote) does not have a url defined in .git/config"
+ remoteurl=$(pwd) # the repository is its own authoritative upstream
url="$1"
remoteurl=${remoteurl%/}
sep=/
url="$1"
remoteurl=${remoteurl%/}
sep=/
path=$1
url=$2
reference="$3"
path=$1
url=$2
reference="$3"
+ quiet=
+ if test -n "$GIT_QUIET"
+ then
+ quiet=-q
+ fi
if test -n "$reference"
then
if test -n "$reference"
then
- git-clone "$reference" -n "$url" "$path"
+ git-clone $quiet "$reference" -n "$url" "$path"
else
else
- git-clone -n "$url" "$path"
+ git-clone $quiet -n "$url" "$path"
fi ||
die "Clone of '$url' into submodule path '$path' failed"
}
fi ||
die "Clone of '$url' into submodule path '$path' failed"
}
die "'$path' already exists and is not a valid git repo"
fi
die "'$path' already exists and is not a valid git repo"
fi
- case "$repo" in
- ./*|../*)
- url=$(resolve_relative_url "$repo") || exit
- ;;
- *)
- url="$repo"
- ;;
- esac
else
module_clone "$path" "$realrepo" "$reference" || exit
else
module_clone "$path" "$realrepo" "$reference" || exit
esac
) || die "Unable to checkout submodule '$path'"
fi
esac
) || die "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'"
git add $force "$path" ||
die "Failed to add submodule '$path'"