1#!/bin/sh
   2test_description='forced push to replace commit we do not have'
   4. ./test-lib.sh
   6test_expect_success setup '
   8        >file1 && git add file1 && test_tick &&
  10        git commit -m Initial &&
  11        git config receive.denyCurrentBranch warn &&
  12        mkdir another && (
  14                cd another &&
  15                git init &&
  16                git fetch --update-head-ok .. master:master
  17        ) &&
  18        >file2 && git add file2 && test_tick &&
  20        git commit -m Second
  21'
  23test_expect_success 'non forced push should die not segfault' '
  25        (
  27                cd another &&
  28                test_must_fail git push .. master:master
  29        )
  30'
  32test_expect_success 'forced push should succeed' '
  34        (
  36                cd another &&
  37                git push .. +master:master
  38        )
  39'
  41test_done