From: Rhys Hardwick <rhys@rhyshardwick.co.uk>
To: git@vger.kernel.org
Subject: [PATCH] cg-add checks to see if file exists
Date: Tue, 26 Apr 2005 23:17:49 +0100 [thread overview]
Message-ID: <200504262317.49739.rhys@rhyshardwick.co.uk> (raw)
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 -- "$@"
reply other threads:[~2005-04-26 22:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200504262317.49739.rhys@rhyshardwick.co.uk \
--to=rhys@rhyshardwick.co.uk \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).