Skip to content

Commit 80ea984

Browse files
pyokagangitster
authored andcommitted
t5520: check reflog action in fast-forward merge
When testing a fast-forward merge with git-pull, check to see if the reflog action is "pull" with the arguments passed to git-pull. While we are in the vicinity, remove the empty line as well. Signed-off-by: Paul Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5504f13 commit 80ea984

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

t/t5520-pull.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ test_expect_success 'pulling into void must not create an octopus' '
8686
'
8787

8888
test_expect_success 'test . as a remote' '
89-
9089
git branch copy master &&
9190
git config branch.copy.remote . &&
9291
git config branch.copy.merge refs/heads/master &&
@@ -95,7 +94,11 @@ test_expect_success 'test . as a remote' '
9594
git checkout copy &&
9695
test "$(cat file)" = file &&
9796
git pull &&
98-
test "$(cat file)" = updated
97+
test "$(cat file)" = updated &&
98+
git reflog -1 >reflog.actual &&
99+
sed "s/^[0-9a-f][0-9a-f]*/OBJID/" reflog.actual >reflog.fuzzy &&
100+
echo "OBJID HEAD@{0}: pull: Fast-forward" >reflog.expected &&
101+
test_cmp reflog.expected reflog.fuzzy
99102
'
100103

101104
test_expect_success 'the default remote . should not break explicit pull' '
@@ -106,7 +109,11 @@ test_expect_success 'the default remote . should not break explicit pull' '
106109
git reset --hard HEAD^ &&
107110
test "$(cat file)" = file &&
108111
git pull . second &&
109-
test "$(cat file)" = modified
112+
test "$(cat file)" = modified &&
113+
git reflog -1 >reflog.actual &&
114+
sed "s/^[0-9a-f][0-9a-f]*/OBJID/" reflog.actual >reflog.fuzzy &&
115+
echo "OBJID HEAD@{0}: pull . second: Fast-forward" >reflog.expected &&
116+
test_cmp reflog.expected reflog.fuzzy
110117
'
111118

112119
test_expect_success 'fail if wildcard spec does not match any refs' '

0 commit comments

Comments
 (0)