Re: [PATCH v2] Ignore dirty submodule states during stash

2 messages, 2 authors, 2016-06-16 · open the first message on its own page

Re: [PATCH v2] Ignore dirty submodule states during stash

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:25

Vasily Titskiy [off-list ref] writes:
quoted hunk
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 2142c1f..1be62f3 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -731,4 +731,38 @@ test_expect_success 'stash list --cc shows combined diff' '
 	test_cmp expect actual
 '
 
+test_expect_success 'stash ignores changes in submodules' '
+	git submodule init &&
Hmmmm... what is this "submodule init" needed for at this point in
the test sequence?
+	git init sub1 &&
+	(
+		cd sub1 &&
+		echo "x" >file1 &&
+		git add file1 &&
+		git commit -a -m "initial sub1"
+	) &&
+	git submodule add ./. sub1 &&
+	echo "main" >file1 &&
+	git add file1 &&
+	git commit -a -m "initial main" &&
+	# make changes in submodule
+	(
+		cd sub1 &&
+		echo "y" >>file1 &&
+		git commit -a -m "change y"
+	) &&
+	git commit sub1 -m "update reference" &&
+	# switch submodule to another revision
+	(
+		cd sub1 &&
+		echo "z" >>file1 &&
+		git commit -a -m "change z"
+	) &&
+	# everything is prepared, check if changes in submodules are ignored
+	echo "local change" >>file1 &&
+	git stash save &&
+	git checkout HEAD~1 &&
+	git submodule update &&
+	git stash pop
+'
+
 test_done

Re: [PATCH v2] Ignore dirty submodule states during stash

From: Vasily Titskiy <hidden>
Date: 2016-06-16 02:19:25

Hi Junio,

You're right, it's redundant here. Should I resubmit the path without this line?

--
  Regards,
  Vasily Titskiy

On Tue, May 17, 2016 at 12:15 PM, Junio C Hamano [off-list ref] wrote:
Vasily Titskiy [off-list ref] writes:
quoted
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 2142c1f..1be62f3 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -731,4 +731,38 @@ test_expect_success 'stash list --cc shows combined diff' '
      test_cmp expect actual
 '

+test_expect_success 'stash ignores changes in submodules' '
+     git submodule init &&
Hmmmm... what is this "submodule init" needed for at this point in
the test sequence?
quoted
+     git init sub1 &&
+     (
+             cd sub1 &&
+             echo "x" >file1 &&
+             git add file1 &&
+             git commit -a -m "initial sub1"
+     ) &&
+     git submodule add ./. sub1 &&
+     echo "main" >file1 &&
+     git add file1 &&
+     git commit -a -m "initial main" &&
+     # make changes in submodule
+     (
+             cd sub1 &&
+             echo "y" >>file1 &&
+             git commit -a -m "change y"
+     ) &&
+     git commit sub1 -m "update reference" &&
+     # switch submodule to another revision
+     (
+             cd sub1 &&
+             echo "z" >>file1 &&
+             git commit -a -m "change z"
+     ) &&
+     # everything is prepared, check if changes in submodules are ignored
+     echo "local change" >>file1 &&
+     git stash save &&
+     git checkout HEAD~1 &&
+     git submodule update &&
+     git stash pop
+'
+
 test_done
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help