git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cg-add checks to see if file exists
@ 2005-04-26 22:17 Rhys Hardwick
  0 siblings, 0 replies; only message in thread
From: Rhys Hardwick @ 2005-04-26 22:17 UTC (permalink / raw)
  To: git

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

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 -- "$@"



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-26 22:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-26 22:17 [PATCH] cg-add checks to see if file exists Rhys Hardwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).