From: "Ramsay Jones" <ramsay@ramsay1.demon.co.uk>
To: <git@vger.kernel.org>
Subject: [PATCH 1/10] Ensure git-clone exits with error if perl script fails.
Date: Wed, 2 Aug 2006 02:03:16 +0100 [thread overview]
Message-ID: <00a201c6b5cf$6fe0d0a0$c47eedc1@ramsay1.demon.co.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]
This helps tests 5400,5600,5700,5710 "fail correctly" rather than
give some false positives. Also ensure cleanup actions in exit trap
work correctly even if user has alias rm='rm -i'.
Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
---
git-clone.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index 6a14b25..47bd8e7 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -205,7 +205,7 @@ # Try using "humanish" part of source re
[ -e "$dir" ] && echo "$dir already exists." && usage
mkdir -p "$dir" &&
D=$(cd "$dir" && pwd) &&
-trap 'err=$?; cd ..; rm -r "$D"; exit $err' 0
+trap 'err=$?; cd ..; rm -rf "$D"; exit $err' 0
case "$bare" in
yes)
GIT_DIR="$D" ;;
@@ -324,7 +324,7 @@ test -d "$GIT_DIR/refs/reference-tmp" &&
if test -f "$GIT_DIR/CLONE_HEAD"
then
# Read git-fetch-pack -k output and store the remote branches.
- perl -e "$copy_refs" "$GIT_DIR" "$use_separate_remote" "$origin"
+ perl -e "$copy_refs" "$GIT_DIR" "$use_separate_remote" "$origin" || exit 1
fi
cd "$D" || exit
--
1.4.1
[-- Attachment #2: P0001.TXT --]
[-- Type: text/plain, Size: 1323 bytes --]
From 08b6502353d6d6191c1ceb1a7095883ffc2b4b4e Mon Sep 17 00:00:00 2001
From: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Date: Sat, 29 Jul 2006 17:12:34 +0100
Subject: [PATCH 1/10] Ensure git-clone exits with error if perl script fails.
This helps tests 5400,5600,5700,5710 "fail correctly" rather than
give some false positives. Also ensure cleanup actions in exit trap
work correctly even if user has alias rm='rm -i'.
Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
---
git-clone.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index 6a14b25..47bd8e7 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -205,7 +205,7 @@ # Try using "humanish" part of source re
[ -e "$dir" ] && echo "$dir already exists." && usage
mkdir -p "$dir" &&
D=$(cd "$dir" && pwd) &&
-trap 'err=$?; cd ..; rm -r "$D"; exit $err' 0
+trap 'err=$?; cd ..; rm -rf "$D"; exit $err' 0
case "$bare" in
yes)
GIT_DIR="$D" ;;
@@ -324,7 +324,7 @@ test -d "$GIT_DIR/refs/reference-tmp" &&
if test -f "$GIT_DIR/CLONE_HEAD"
then
# Read git-fetch-pack -k output and store the remote branches.
- perl -e "$copy_refs" "$GIT_DIR" "$use_separate_remote" "$origin"
+ perl -e "$copy_refs" "$GIT_DIR" "$use_separate_remote" "$origin" || exit 1
fi
cd "$D" || exit
--
1.4.1
reply other threads:[~2006-08-02 1:03 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='00a201c6b5cf$6fe0d0a0$c47eedc1@ramsay1.demon.co.uk' \
--to=ramsay@ramsay1.demon.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