Replace instances of export VAR=VAL with VAR=VAL; export VAR
It might be POSIX, but there are shells that do not like the expression 'export VAR=VAL'. To be on the safe side, rewrite them into 'VAR=VAL' and 'export VAR'. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 28, 2007 at 15:56 UTC
3addc94aff0b10730c6b023e1a4a5d677e53d5a7
3 files changed
+19
-13
git-clone.sh
+1
-1
@@ -229,7 +229,7 @@ cleanup() {
229
trap cleanup 0
230
mkdir -p "$dir" && D=$(cd "$dir" && pwd) || usage
231
test -n "$GIT_WORK_TREE" && mkdir -p "$GIT_WORK_TREE" &&
232
-W=$(cd "$GIT_WORK_TREE" && pwd) && export GIT_WORK_TREE="$W"
232
+W=$(cd "$GIT_WORK_TREE" && pwd) && GIT_WORK_TREE="$W" && export GIT_WORK_TREE
233
if test yes = "$bare" || test -n "$GIT_WORK_TREE"; then
234
GIT_DIR="$D"
235
else
git-filter-branch.sh
+12
-8
@@ -66,17 +66,17 @@ set_ident () {
66
h
67
s/^'$lid' \([^<]*\) <[^>]*> .*$/\1/
68
s/'\''/'\''\'\'\''/g
69
- s/.*/export GIT_'$uid'_NAME='\''&'\''/p
69
+ s/.*/GIT_'$uid'_NAME='\''&'\''; export GIT_'$uid'_NAME/p
70
71
g
72
s/^'$lid' [^<]* <\([^>]*\)> .*$/\1/
73
s/'\''/'\''\'\'\''/g
74
- s/.*/export GIT_'$uid'_EMAIL='\''&'\''/p
74
+ s/.*/GIT_'$uid'_EMAIL='\''&'\''; export GIT_'$uid'_EMAIL/p
75
76
g
77
s/^'$lid' [^<]* <[^>]*> \(.*\)$/\1/
78
s/'\''/'\''\'\'\''/g
79
- s/.*/export GIT_'$uid'_DATE='\''&'\''/p
79
+ s/.*/GIT_'$uid'_DATE='\''&'\''; export GIT_'$uid'_DATE/p
80
81
q
82
}
@@ -84,7 +84,7 @@ set_ident () {
84
85
LANG=C LC_ALL=C sed -ne "$pick_id_script"
86
# Ensure non-empty id name.
87
- echo "[ -n \"\$GIT_${uid}_NAME\" ] || export GIT_${uid}_NAME=\"\${GIT_${uid}_EMAIL%%@*}\""
87
+ echo "case \"\$GIT_${uid}_NAME\" in \"\") GIT_${uid}_NAME=\"\${GIT_${uid}_EMAIL%%@*}\" && export GIT_${uid}_NAME;; esac"
88
}
89
90
USAGE="[--env-filter <command>] [--tree-filter <command>] \
@@ -206,7 +206,8 @@ done < "$tempdir"/backup-refs
206
ORIG_GIT_DIR="$GIT_DIR"
207
ORIG_GIT_WORK_TREE="$GIT_WORK_TREE"
208
ORIG_GIT_INDEX_FILE="$GIT_INDEX_FILE"
209
-export GIT_DIR GIT_WORK_TREE=.
209
+GIT_WORK_TREE=.
210
+export GIT_DIR GIT_WORK_TREE
211
212
# These refs should be updated if their heads were rewritten
213
@@ -231,7 +232,8 @@ done > "$tempdir"/heads
232
test -s "$tempdir"/heads ||
233
die "Which ref do you want to rewrite?"
234
234
-export GIT_INDEX_FILE="$(pwd)/../index"
235
+GIT_INDEX_FILE="$(pwd)/../index"
236
+export GIT_INDEX_FILE
237
git read-tree || die "Could not seed the index"
238
239
ret=0
@@ -267,7 +269,8 @@ while read commit parents; do
269
git read-tree -i -m $commit:"$filter_subdir"
270
esac || die "Could not initialize the index"
271
270
- export GIT_COMMIT=$commit
272
+ GIT_COMMIT=$commit
273
+ export GIT_COMMIT
274
git cat-file commit "$commit" >../commit ||
275
die "Cannot read commit $commit"
276
@@ -401,7 +404,8 @@ if [ "$filter_tag_name" ]; then
404
405
[ -f "../map/$sha1" ] || continue
406
new_sha1="$(cat "../map/$sha1")"
404
- export GIT_COMMIT="$sha1"
407
+ GIT_COMMIT="$sha1"
408
+ export GIT_COMMIT
409
new_ref="$(echo "$ref" | eval "$filter_tag_name")" ||
410
die "tag name filter failed: $filter_tag_name"
411
git-quiltimport.sh
+6
-4
@@ -77,8 +77,9 @@ for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
77
}
78
79
# Parse the author information
80
- export GIT_AUTHOR_NAME=$(sed -ne 's/Author: //p' "$tmp_info")
81
- export GIT_AUTHOR_EMAIL=$(sed -ne 's/Email: //p' "$tmp_info")
80
+ GIT_AUTHOR_NAME=$(sed -ne 's/Author: //p' "$tmp_info")
81
+ GIT_AUTHOR_EMAIL=$(sed -ne 's/Email: //p' "$tmp_info")
82
+ export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
83
while test -z "$GIT_AUTHOR_EMAIL" && test -z "$GIT_AUTHOR_NAME" ; do
84
if [ -n "$quilt_author" ] ; then
85
GIT_AUTHOR_NAME="$quilt_author_name";
@@ -104,8 +105,9 @@ for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
105
GIT_AUTHOR_EMAIL="$patch_author_email"
106
fi
107
done
107
- export GIT_AUTHOR_DATE=$(sed -ne 's/Date: //p' "$tmp_info")
108
- export SUBJECT=$(sed -ne 's/Subject: //p' "$tmp_info")
108
+ GIT_AUTHOR_DATE=$(sed -ne 's/Date: //p' "$tmp_info")
109
+ SUBJECT=$(sed -ne 's/Subject: //p' "$tmp_info")
110
+ export GIT_AUTHOR_DATE SUBJECT
111
if [ -z "$SUBJECT" ] ; then
112
SUBJECT=$(echo $patch_name | sed -e 's/.patch$//')
113
fi