#!/usr/bin/env bash
#
# Remove files from a GIT repository.
# Copyright (c) Petr Baudis, 2005
#
# Takes a list of file names at the command line, and schedules them
# for removal from the GIT repository at the next commit.
#
# OPTIONS
# -------
# -n::
#	Do not delete the files
#	from the tree physically, if they are still there. So it effectively
#	just makes Cogito to stop caring about the file.

USAGE="cg-rm [-n] FILE..."

. ${COGITO_LIB}cg-Xlib

no_delete=
if [ "$1" = "-n" ]; then
	no_delete=1
	shift
fi

[ "$1" ] || usage

[ "$no_delete" ] || rm -f "$@"
git-update-cache --force-remove -- "$@"
