File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,13 @@ while read commit parents; do
332
332
parentstr=
333
333
for parent in $parents ; do
334
334
for reparent in $( map " $parent " ) ; do
335
- parentstr=" $parentstr -p $reparent "
335
+ case " $parentstr " in
336
+ * " -p $reparent " * )
337
+ ;;
338
+ * )
339
+ parentstr=" $parentstr -p $reparent "
340
+ ;;
341
+ esac
336
342
done
337
343
done
338
344
if [ " $filter_parent " ]; then
Original file line number Diff line number Diff line change @@ -308,6 +308,17 @@ test_expect_success 'Prune empty commits' '
308
308
test_cmp expect actual
309
309
'
310
310
311
+ test_expect_success ' prune empty collapsed merges' '
312
+ test_config merge.ff false &&
313
+ git rev-list HEAD >expect &&
314
+ test_commit to_remove_2 &&
315
+ git reset --hard HEAD^ &&
316
+ test_merge non-ff to_remove_2 &&
317
+ git filter-branch -f --index-filter "git update-index --remove to_remove_2.t" --prune-empty HEAD &&
318
+ git rev-list HEAD >actual &&
319
+ test_cmp expect actual
320
+ '
321
+
311
322
test_expect_success ' --remap-to-ancestor with filename filters' '
312
323
git checkout master &&
313
324
git reset --hard A &&
You can’t perform that action at this time.
0 commit comments