Repository navigation
Commit 25f9e62
committed
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.1 parent b4753e5 commit 25f9e62
1 file changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
356 | 376 | | |
357 | 377 | | |
358 | 378 | | |
| |||
0 commit comments