Thread (1 message) 1 message, 1 author, 2020-11-09

Re: [Outreachy][PATCH v6] diff: do not show submodule with untracked files as "-dirty"

From: Junio C Hamano <hidden>
Date: 2020-11-09 17:02:07

Sangeeta [off-list ref] writes:
quoted
quoted
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index ca04fac417..9104d1946d 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -765,6 +765,11 @@ test_expect_success 'setup different kinds of dirty submodules' '
      cat >expected <<-\EOF &&
      dirty-both-ways
      dirty-head
+     EOF
+     git -C for-submodules diff-files --name-only --ignore-submodules=none >actual &&
+     cat >expected <<-\EOF &&
+     dirty-both-ways
+     dirty-head
This will throw-away above change to "expected", I think this is not
what you expected to write!
I am sorry I couldn't understand what you mean by that. I think that
is what I expected to write. I want those changes to be in "expected".
Looking at the above quoted part again...

	cat >expected <<-\EOF &&
		... content 1 ...
	EOF
        git ... >actual &&
	cat >expected <<-\EOF &&
		... content 2 ...
	EOF

I think Đoàn Trần Công Danh wants to say is that expected originally
has content 1, and that is discarded because you overwrite the same
file with content 2.  So either

 - if content1 and content2 are identical, perhaps you do not have
   to write content2 into expected at all, or

 - if content1 and content2 are different, perhaps you forgot to
   consume content1 before overwriting it.

THe latter is quite plausible, as the original test without your
addition must be consuming content1 after the part you added.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help