From: Junio C Hamano Date: Thu, 11 Mar 2010 20:16:42 GMT Subject: Re: [PATCH] git status: Fix false positive "new commits" output for dirty submodules Message-ID: <7vpr3azk9h.fsf@alter.siamese.dyndns.org> In-Reply-To: <7v3a061v7m.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > Jens Lehmann writes: > >> Another way to fix this bug would have been to enter the correct sha1 >> into two->sha1 for submodules with new commits. > > I didn't follow all the codepaths involved, but it might be worth a try. > The beginning of the patch may look something like this, and then you > would probably have to fix potential fallouts in diff.c from this change. Here is a fix of one of the fallouts. diff.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/diff.c b/diff.c index dfdfa1a..eefe836 100644 --- a/diff.c +++ b/diff.c @@ -3221,6 +3221,8 @@ static void diff_resolve_rename_copy(void) } else if (hashcmp(p->one->sha1, p->two->sha1) || p->one->mode != p->two->mode || + p->one->dirty_submodule || + p->two->dirty_submodule || is_null_sha1(p->one->sha1)) p->status = DIFF_STATUS_MODIFIED; else {