Re: [PATCH] mv: Fix spurious warning when moving a file in presence of submodules
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Oct 13, 2013, 15:05 UTC
- Message-ID
- <vpqr4bp6wkh.fsf@anie.imag.fr>
- In-Reply-To
- <525A8965.3040407@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
> static struct lock_file lock_file; > +#define SUBMODULE_WITH_GITDIR ((const char *)1)
I don't like very much hardcoded addresses like this. Are you 100% sure address 1 will never be returned by xstrdup on any platform? The risk is small if not negligible, but I'm unconfortable with this. Isn't there an alternative (NULL, or empty string) that is guaranteed to never happen?
> +test_expect_success 'git mv moves a submodule with a .git directory and .gitmodules' '
This doesn't seem to test the problem I was having (move a file, not a submodule). Is this intentional?
In any case, this fixes my problem, thanks!
-- Matthieu Moy http://www-verimag.imag.fr/~moy/