summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-09-21 15:15:28 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-09-21 15:15:28 -0700
commitae1ae600db5e159c4563ee080531b9500c26d635 (patch)
tree95925e9c5cccc44f2aeeaeff65f035e9093d843a
parentMerge branch 'va/i18n' (diff)
parentrebase-interactive: drop early check for valid ident (diff)
downloadtgif-ae1ae600db5e159c4563ee080531b9500c26d635.tar.xz
Merge branch 'jk/rebase-i-drop-ident-check'
Even when "git pull --rebase=preserve" (and the underlying "git rebase --preserve") can complete without creating any new commit (i.e. fast-forwards), it still insisted on having a usable ident information (read: user.email is set correctly), which was less than nice. As the underlying commands used inside "git rebase" would fail with a more meaningful error message and advice text when the bogus ident matters, this extra check was removed. * jk/rebase-i-drop-ident-check: rebase-interactive: drop early check for valid ident
-rw-r--r--git-rebase--interactive.sh3
-rwxr-xr-xt/t7517-per-repo-email.sh47
2 files changed, 47 insertions, 3 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 6fd6d4e5f6..5e474e4a85 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -1141,9 +1141,6 @@ To continue rebase after editing, run:
;;
esac
-git var GIT_COMMITTER_IDENT >/dev/null ||
- die "$(gettext "You need to set your committer info first")"
-
comment_for_reflog start
if test ! -z "$switch_to"
diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh
index 337e6e30c3..2a22fa7588 100755
--- a/t/t7517-per-repo-email.sh
+++ b/t/t7517-per-repo-email.sh
@@ -36,4 +36,51 @@ test_expect_success 'succeeds cloning if global email is not set' '
git clone . clone
'
+test_expect_success 'set up rebase scenarios' '
+ # temporarily enable an actual ident for this setup
+ test_config user.email foo@example.com &&
+ test_commit new &&
+ git branch side-without-commit HEAD^ &&
+ git checkout -b side-with-commit HEAD^ &&
+ test_commit side
+'
+
+test_expect_success 'fast-forward rebase does not care about ident' '
+ git checkout -B tmp side-without-commit &&
+ git rebase master
+'
+
+test_expect_success 'non-fast-forward rebase refuses to write commits' '
+ test_when_finished "git rebase --abort || true" &&
+ git checkout -B tmp side-with-commit &&
+ test_must_fail git rebase master
+'
+
+test_expect_success 'fast-forward rebase does not care about ident (interactive)' '
+ git checkout -B tmp side-without-commit &&
+ git rebase -i master
+'
+
+test_expect_success 'non-fast-forward rebase refuses to write commits (interactive)' '
+ test_when_finished "git rebase --abort || true" &&
+ git checkout -B tmp side-with-commit &&
+ test_must_fail git rebase -i master
+'
+
+test_expect_success 'noop interactive rebase does not care about ident' '
+ git checkout -B tmp side-with-commit &&
+ git rebase -i HEAD^
+'
+
+test_expect_success 'fast-forward rebase does not care about ident (preserve)' '
+ git checkout -B tmp side-without-commit &&
+ git rebase -p master
+'
+
+test_expect_success 'non-fast-forward rebase refuses to write commits (preserve)' '
+ test_when_finished "git rebase --abort || true" &&
+ git checkout -B tmp side-with-commit &&
+ test_must_fail git rebase -p master
+'
+
test_done