blob: c278adaa5a2556327a820cdeb98943b58d1e429f [file] [log] [blame]
Junio C Hamano7ecee332010-01-24 10:11:27 -08001#!/bin/sh
2
3test_description='git pull message generation'
4
5. ./test-lib.sh
6
7dollar='$Dollar'
8
9test_expect_success setup '
10 test_commit initial afile original &&
11 git clone . cloned &&
12 (
13 cd cloned &&
14 echo added >bfile &&
15 git add bfile &&
16 test_tick &&
17 git commit -m "add bfile"
18 ) &&
19 test_tick && test_tick &&
Paul Tan5061a442015-05-18 21:39:56 +080020 echo "second" >afile &&
21 git add afile &&
22 git commit -m "second commit" &&
Junio C Hamano7ecee332010-01-24 10:11:27 -080023 echo "original $dollar" >afile &&
24 git add afile &&
25 git commit -m "do not clobber $dollar signs"
26'
27
28test_expect_success pull '
29(
30 cd cloned &&
31 git pull --log &&
32 git log -2 &&
33 git cat-file commit HEAD >result &&
34 grep Dollar result
35)
36'
37
Paul Tan5061a442015-05-18 21:39:56 +080038test_expect_success '--log=1 limits shortlog length' '
39(
40 cd cloned &&
41 git reset --hard HEAD^ &&
42 test "$(cat afile)" = original &&
43 test "$(cat bfile)" = added &&
44 git pull --log=1 &&
45 git log -3 &&
46 git cat-file commit HEAD >result &&
47 grep Dollar result &&
48 ! grep "second commit" result
49)
50'
51
Junio C Hamano7ecee332010-01-24 10:11:27 -080052test_done