@@ -165,4 +165,49 @@ test_expect_success 'git pull --allow-unrelated-histories' '
165165 )
166166'
167167
168+ test_expect_success ' git pull does not add a sign-off line' '
169+ test_when_finished "rm -fr src dst actual" &&
170+ git init src &&
171+ test_commit -C src one &&
172+ git clone src dst &&
173+ test_commit -C src two &&
174+ git -C dst pull --no-ff &&
175+ git -C dst show -s --pretty="format:%(trailers)" HEAD >actual &&
176+ test_must_be_empty actual
177+ '
178+
179+ test_expect_success ' git pull --no-signoff does not add sign-off line' '
180+ test_when_finished "rm -fr src dst actual" &&
181+ git init src &&
182+ test_commit -C src one &&
183+ git clone src dst &&
184+ test_commit -C src two &&
185+ git -C dst pull --no-signoff --no-ff &&
186+ git -C dst show -s --pretty="format:%(trailers)" HEAD >actual &&
187+ test_must_be_empty actual
188+ '
189+
190+ test_expect_success ' git pull --signoff add a sign-off line' '
191+ test_when_finished "rm -fr src dst expected actual" &&
192+ echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >expected &&
193+ git init src &&
194+ test_commit -C src one &&
195+ git clone src dst &&
196+ test_commit -C src two &&
197+ git -C dst pull --signoff --no-ff &&
198+ git -C dst show -s --pretty="format:%(trailers)" HEAD >actual &&
199+ test_cmp expected actual
200+ '
201+
202+ test_expect_success ' git pull --no-signoff flag cancels --signoff flag' '
203+ test_when_finished "rm -fr src dst actual" &&
204+ git init src &&
205+ test_commit -C src one &&
206+ git clone src dst &&
207+ test_commit -C src two &&
208+ git -C dst pull --signoff --no-signoff --no-ff &&
209+ git -C dst show -s --pretty="format:%(trailers)" HEAD >actual &&
210+ test_must_be_empty actual
211+ '
212+
168213test_done
0 commit comments