Skip to content

Commit 1423058

Browse files
committed
Merge branch 'pt/pull-log-n'
"git pull --log" and "git pull --no-log" worked as expected, but "git pull --log=20" did not. * pt/pull-log-n: pull: handle --log=<n>
2 parents c37d7b5 + 5061a44 commit 1423058

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

git-pull.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ do
8181
diffstat=--no-stat ;;
8282
--stat|--summary)
8383
diffstat=--stat ;;
84-
--log|--no-log)
85-
log_arg=$1 ;;
84+
--log|--log=*|--no-log)
85+
log_arg="$1" ;;
8686
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
8787
no_commit=--no-commit ;;
8888
--c|--co|--com|--comm|--commi|--commit)

t/t5524-pull-msg.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ test_expect_success setup '
1717
git commit -m "add bfile"
1818
) &&
1919
test_tick && test_tick &&
20+
echo "second" >afile &&
21+
git add afile &&
22+
git commit -m "second commit" &&
2023
echo "original $dollar" >afile &&
2124
git add afile &&
2225
git commit -m "do not clobber $dollar signs"
@@ -32,4 +35,18 @@ test_expect_success pull '
3235
)
3336
'
3437

38+
test_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+
3552
test_done

0 commit comments

Comments
 (0)