Re: [PATCH] git status: Fix false positive "new commits" output for dirty submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jens Lehmann <Jens.Lehmann@xxxxxx> 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.

 diff-lib.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/diff-lib.c b/diff-lib.c
index d7e13cb..a147d9c 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -182,10 +182,9 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
 		    && !DIFF_OPT_TST(&revs->diffopt, IGNORE_SUBMODULES)
 		    && (!changed || (revs->diffopt.output_format & DIFF_FORMAT_PATCH))
 		    && is_submodule_modified(ce->name)) {
-			changed = 1;
 			dirty_submodule = 1;
 		}
-		if (!changed) {
+		if (!changed && !dirty_submodule) {
 			ce_mark_uptodate(ce);
 			if (!DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER))
 				continue;
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]