841573210a83e0f6c33ef135e7fc86b45af14802
   1#!/bin/sh
   2#
   3# Copyright (c) 2006 Carl D. Worth
   4#
   5
   6test_description='Test of the various options to git-rm.'
   7
   8. ./test-lib.sh
   9
  10# Setup some files to be removed
  11touch foo bar
  12git-add foo bar
  13# Need one to test --
  14touch -- -q
  15git update-index --add -- -q
  16git-commit -m "add foo, bar, and -q"
  17
  18test_expect_success \
  19    'Pre-check that foo is in index before git-rm foo' \
  20    'git-ls-files --error-unmatch foo'
  21
  22test_expect_success \
  23    'Test that git-rm foo succeeds' \
  24    'git-rm foo'
  25
  26test_expect_failure \
  27    'Post-check that foo is not in index after git-rm foo' \
  28    'git-ls-files --error-unmatch foo'
  29
  30test_expect_success \
  31    'Test that "git-rm -f bar" works' \
  32    'git-rm -f bar'
  33
  34test_expect_failure \
  35    'Post-check that bar no longer exists' \
  36    '[ -f bar ]'
  37
  38test_expect_success \
  39    'Test that "git-rm -- -q" works to delete a file named -q' \
  40    'git-rm -- -q'
  41
  42test_done