Skip to content

Commit

Permalink
t5520: check reflog action in fast-forward merge
Browse files Browse the repository at this point in the history
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 <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Paul Tan authored and Junio C Hamano committed May 29, 2015
1 parent 5504f13 commit 80ea984
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions t/t5520-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ test_expect_success 'pulling into void must not create an octopus' '
'

test_expect_success 'test . as a remote' '
git branch copy master &&
git config branch.copy.remote . &&
git config branch.copy.merge refs/heads/master &&
Expand All @@ -95,7 +94,11 @@ test_expect_success 'test . as a remote' '
git checkout copy &&
test "$(cat file)" = file &&
git pull &&
test "$(cat file)" = updated
test "$(cat file)" = updated &&
git reflog -1 >reflog.actual &&
sed "s/^[0-9a-f][0-9a-f]*/OBJID/" reflog.actual >reflog.fuzzy &&
echo "OBJID HEAD@{0}: pull: Fast-forward" >reflog.expected &&
test_cmp reflog.expected reflog.fuzzy
'

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

test_expect_success 'fail if wildcard spec does not match any refs' '
Expand Down

0 comments on commit 80ea984

Please sign in to comment.