re-arrange-commits--after
kiprasmel
tagged this
03 Apr 10:44
previously, in `gitStackedRebase`, there were 3 invocations of `applyIfNeedsToApply`. there are still 3, but what differs is: previously, the 3rd would be invoked if and only if the `config.autoApplyIfNeeded` was true, i.e., it was NOT mandatory. however, the 1st invocation, which also is NOT mandatory, did not have such guardrail, and, if the `config.autoApplyIfNeeded` was false, would prompt the user with the common message: `need to --apply before continuing. proceed? [Y/n/(a)lways] ` this is wrong, because this (1st) invocation is not mandatory, meanwhile the message makes it look like it is, thus confusing the user & their longer term understanding of when an --apply is actually needed. to further add to the confusion, the 1st invocation worked correctly apart from the message - it (1st invoc) was not made mandatory, i.e. would not stop the program execution if user did not allow. --- now, there's a clear distinction of mandatory vs not, and `applyIfNeedsToApply` works accordingly to it. related parts were also cleaned up. also, created a test for this -- yay! Signed-off-by: Kipras Melnikovas <[email protected]>