Re: [PATCH v2] submodule: prevent warning in summary output
- From
Chris Packham <judge.packham@gmail.com>
- Date
- Aug 26, 2013, 08:26 UTC
- Message-ID
- <521B114B.2080709@gmail.com>
- In-Reply-To
- <1376958397-800967-1-git-send-email-sandals@crustytoothpaste.net>
Hi Brian,
Sorry for the delay.
On 20/08/13 12:26, brian m. carlson wrote:
Show 26 quoted lines
> When git submodule summary is run and there is a deleted submodule, there is an
> warning from git rev-parse:
>
> fatal: Not a git repository: '.vim/pathogen/.git'
>
> Silence this warning, since it is fully expected that a deleted submodule will
> not be a git repository.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
>
> I hesitated to add the test for $status because it will end up having no effect
> since we exclude that case later. However, for correctness, I included it.
>
> git-submodule.sh | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 2979197..eec3135 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -1070,7 +1070,10 @@ cmd_summary() {
> missing_src=
> missing_dst=
>
> + test $status = D && missing_src=tI tend to agree with you that this line is redundant. I'm not sure that it's what Jens was looking for in v1.
Show 6 quoted lines
> + > test $mod_src = 160000 && > + test -e "$name/.git" && > ! GIT_DIR="$name/.git" git-rev-parse -q --verify $sha1_src^0 >/dev/null && > missing_src=t >
This part looks good to me.