Hi,
This is a patch to check if the file being added exists, and if not, issues a warning and dies.
Rhys
Signed-off-by: Rhys Hardwick <rhys@rhyshardwick.co.uk
Show changes to diff +6 −0
Index: cg-add =================================================================== --- 6159f313b10f0cfcdfedd63d6fb044029fe46aaa/cg-add (mode:100755 sha1:8ba5351a4c7e28a577ea1aa4afa1078c54e9bccc) +++ uncommitted/cg-add (mode:100755) @@ -10,4 +10,10 @@ [ "$1" ] || die "usage: cg-add FILE..." +if [ -f "$1" ]; then + echo "Adding file $1" +else + die "$1 does not exist" +fi + update-cache --add -- "$@"