You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add test ensuring empty submodule directories are removed
This threw me for a loop for a little while because of the differences
in behavior between git 1.8 and 2.3 (the versions I run on CentOS and
Mac OS X, respectively).
In git 1.8, you can't stash submodule changes, but you can in git 2.3.
Thus there's a slight difference in what happens given the code we have
now.
In git 1.8, we would check to see if you had only staged submodule
changes (by checking if no stash was created), and would not hard
reset in that case. Since there was no hard reset, no empty submodule
directory would be created, and all is well (though we don't have any
stash to restore anyway).
In git 2.3, a stash would be created so we would hard reset. This would
create an empty submodule directory which we would then have to
explicitly remove in order to restore the stash we just created.
The test I've added passes for both versions of git, even though it's
technically only testing git 2.3. We'll have to come up with a way of
running overcommit tests against multiple versions of git in Travis so
we know we're not writing version-specific implementations.
0 commit comments