Skip to content

Commit 4cb9fe3

Browse files
committed
Merge branch 'pt/pull-log-n' into maint
"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 7e46f27 + 5061a44 commit 4cb9fe3

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
@@ -84,8 +84,8 @@ do
8484
diffstat=--no-stat ;;
8585
--stat|--summary)
8686
diffstat=--stat ;;
87-
--log|--no-log)
88-
log_arg=$1 ;;
87+
--log|--log=*|--no-log)
88+
log_arg="$1" ;;
8989
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
9090
no_commit=--no-commit ;;
9191
--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)