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 <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Paul Tan committed
May 29, 2015 at 19:44 UTC
80ea984da6c585ca4d63de0d8a2ce2873448e228
1 file changed
+10
-3
t/t5520-pull.sh
+10
-3
@@ -86,7 +86,6 @@ test_expect_success 'pulling into void must not create an octopus' '
86
'
87
88
test_expect_success 'test . as a remote' '
89
-
89
git branch copy master &&
90
git config branch.copy.remote . &&
91
git config branch.copy.merge refs/heads/master &&
@@ -95,7 +94,11 @@ test_expect_success 'test . as a remote' '
94
git checkout copy &&
95
test "$(cat file)" = file &&
96
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
102
'
103
104
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' '
109
git reset --hard HEAD^ &&
110
test "$(cat file)" = file &&
111
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
117
'
118
119
test_expect_success 'fail if wildcard spec does not match any refs' '