git stash doesn't handle submodules with modifications

From: Steffen Prohaska <hidden>
Date: 2016-06-15 22:43:28

Stash in combination with a submodule does not work as
expected. A submodule with modifications is not handled
correctly if it has modifications.

I started with some changes in the working tree and with
a submodule having changes, too. I do 'git stash', which
stashes away all my changes to the working tree, but it
does not store changes to the submodule. Thus,
'git status' still shows a modified submodule.

'git apply' refuses to work with a modified submodule with:
'Cannot restore on top of a dirty state'.

So, I have stashed my changes, but can't get them back
easily. This happend to me in the msysgit repo, which
includes git as a submodule.

What would be the right way to solve this?
I'd expect that stash somehow would ignore the submodule.
But it may be more correct to include the submodule into
the stash?

	Steffen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help