Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-10-25 10:54:06 +0400
committerJunio C Hamano <gitster@pobox.com>2013-10-26 01:54:18 +0400
commitb3e9ce13320f62e07fcb88a5cdf3c0462c195e95 (patch)
tree435fdf70b5ae07e3ec5bde5fc984a1fd7a24ece9 /t/t7105-reset-patch.sh
parent954312a3ff76652a954b730ae69a031f98293a99 (diff)
reset: pass real rev name to add--interactive
The add--interactive --patch mode adjusts the UI based on whether we are pulling changes from HEAD or elsewhere (in the former case it asks to unstage the reverse hunk, rather than apply the forward hunk). Commit 166ec2e taught reset to work on an unborn branch, but in doing so, switched to always providing add--interactive with the sha1 rather than the symbolic name. This meant we always used the "apply" interface, even for "git reset -p HEAD". We can fix this by passing the symbolic name to add--interactive. Since it understands unborn branches these days, we do not even have to cover this special case ourselves; we can simply pass HEAD. The tests in t7105 now check that the right interface is used in each circumstance (and notice the regression from 166ec2e we are fixing). The test in t7106 checks that we get this right for the unborn case, too (not a regression, since it didn't work at all before, but a nice improvement). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7105-reset-patch.sh')
-rwxr-xr-xt/t7105-reset-patch.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/t/t7105-reset-patch.sh b/t/t7105-reset-patch.sh
index 95fab20361..98b7d7b969 100755
--- a/t/t7105-reset-patch.sh
+++ b/t/t7105-reset-patch.sh
@@ -25,15 +25,17 @@ test_expect_success PERL 'saying "n" does nothing' '
'
test_expect_success PERL 'git reset -p' '
- (echo n; echo y) | git reset -p &&
+ (echo n; echo y) | git reset -p >output &&
verify_state dir/foo work head &&
- verify_saved_state bar
+ verify_saved_state bar &&
+ test_i18ngrep "Unstage" output
'
test_expect_success PERL 'git reset -p HEAD^' '
- (echo n; echo y) | git reset -p HEAD^ &&
+ (echo n; echo y) | git reset -p HEAD^ >output &&
verify_state dir/foo work parent &&
- verify_saved_state bar
+ verify_saved_state bar &&
+ test_i18ngrep "Apply" output
'
# The idea in the rest is that bar sorts first, so we always say 'y'