Skip to content

Commit ae1ae60

Browse files
committed
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
2 parents 1fe6f5f + 1e461c4 commit ae1ae60

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

git-rebase--interactive.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,9 +1141,6 @@ To continue rebase after editing, run:
11411141
;;
11421142
esac
11431143

1144-
git var GIT_COMMITTER_IDENT >/dev/null ||
1145-
die "$(gettext "You need to set your committer info first")"
1146-
11471144
comment_for_reflog start
11481145

11491146
if test ! -z "$switch_to"

t/t7517-per-repo-email.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,51 @@ test_expect_success 'succeeds cloning if global email is not set' '
3636
git clone . clone
3737
'
3838

39+
test_expect_success 'set up rebase scenarios' '
40+
# temporarily enable an actual ident for this setup
41+
test_config user.email [email protected] &&
42+
test_commit new &&
43+
git branch side-without-commit HEAD^ &&
44+
git checkout -b side-with-commit HEAD^ &&
45+
test_commit side
46+
'
47+
48+
test_expect_success 'fast-forward rebase does not care about ident' '
49+
git checkout -B tmp side-without-commit &&
50+
git rebase master
51+
'
52+
53+
test_expect_success 'non-fast-forward rebase refuses to write commits' '
54+
test_when_finished "git rebase --abort || true" &&
55+
git checkout -B tmp side-with-commit &&
56+
test_must_fail git rebase master
57+
'
58+
59+
test_expect_success 'fast-forward rebase does not care about ident (interactive)' '
60+
git checkout -B tmp side-without-commit &&
61+
git rebase -i master
62+
'
63+
64+
test_expect_success 'non-fast-forward rebase refuses to write commits (interactive)' '
65+
test_when_finished "git rebase --abort || true" &&
66+
git checkout -B tmp side-with-commit &&
67+
test_must_fail git rebase -i master
68+
'
69+
70+
test_expect_success 'noop interactive rebase does not care about ident' '
71+
git checkout -B tmp side-with-commit &&
72+
git rebase -i HEAD^
73+
'
74+
75+
test_expect_success 'fast-forward rebase does not care about ident (preserve)' '
76+
git checkout -B tmp side-without-commit &&
77+
git rebase -p master
78+
'
79+
80+
test_expect_success 'non-fast-forward rebase refuses to write commits (preserve)' '
81+
test_when_finished "git rebase --abort || true" &&
82+
git checkout -B tmp side-with-commit &&
83+
test_must_fail git rebase -p master
84+
'
85+
3986
test_done

0 commit comments

Comments
 (0)