Subject: Re: [PATCH] Add git-submodule command

From: Simon Hausmann <[email-masked]>
Date: Sat, 26 May 2007 16:37:56 +0200

On Saturday 26 May 2007 15:56:40 Lars Hjemli wrote:
[...]
> +modules_init()
> +{
> +	git ls-files --stage -- "$@" | grep -e '^160000 ' |
> +	while read mode sha1 stage path
> +	do
> +		# Skip submodule paths that already contain a .git directory.
> +		# This will also trigger if $path is a symlink to a git
> +		# repository
> +		test -d "$path"/.git && continue
> +
> +		# If there already is a directory at the submodule path,
> +		# expect it to be empty (since that is the default checkout
> +		# action) and try to remove it.
> +		# Note: if $path is a symlink to a directory the test will
> +		# succeed but the rmdir will fail. We might want to fix this.
> +		if test -d "$path"
> +		then
> +			rmdir "$path" 2>/dev/null ||
> +			die "Directory '$path' exist, but is neither empty "
> +			    "nor a git repository"
> +		fi
> +
> +		test -e "$path"
> +		die "A file already exist at path '$path'"

Isn't there a && missing at the end of the test line? :)

Simon