reflog test: add more tests for 'reflog delete'
This adds more tests for 'reflog delete' and marks it as broken, as currently a call to 'git reflog delete HEAD@{1}' deletes entries in the currently checked out branch's log, not the HEAD log. Noticed by John Wiegley Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pieter de Bie committed
Aug 10, 2008 at 01:33 UTC
38881a9066fcb3ce6e0438e6d7b20cce22ece411
1 file changed
+18
-4
t/t1410-reflog.sh
+18
-4
@@ -175,7 +175,7 @@ test_expect_success 'recover and check' '
175
176
'
177
178
-test_expect_success 'delete' '
178
+test_expect_failure 'delete' '
179
echo 1 > C &&
180
test_tick &&
181
git commit -m rat C &&
@@ -188,16 +188,30 @@ test_expect_success 'delete' '
188
test_tick &&
189
git commit -m tiger C &&
190
191
- test 5 = $(git reflog | wc -l) &&
191
+ HEAD_entry_count=$(git reflog | wc -l)
192
+ master_entry_count=$(git reflog show master | wc -l)
193
+
194
+ test $HEAD_entry_count = 5 &&
195
+ test $master_entry_count = 5 &&
196
+
197
198
git reflog delete master@{1} &&
199
git reflog show master > output &&
195
- test 4 = $(wc -l < output) &&
200
+ test $(($master_entry_count - 1)) = $(wc -l < output) &&
201
+ test $HEAD_entry_count = $(git reflog | wc -l) &&
202
! grep ox < output &&
203
204
+ master_entry_count=$(wc -l < output)
205
+
206
+ git reflog delete HEAD@{1} &&
207
+ test $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&
208
+ test $master_entry_count = $(git reflog show master | wc -l) &&
209
+
210
+ HEAD_entry_count=$(git reflog | wc -l)
211
+
212
git reflog delete master@{07.04.2005.15:15:00.-0700} &&
213
git reflog show master > output &&
200
- test 3 = $(wc -l < output) &&
214
+ test $(($master_entry_count - 1)) = $(wc -l < output) &&
215
! grep dragon < output
216
217
'