Skip to content

Commit c579f53

Browse files
committed
Merge branch 'js/export-with-assignment'
* js/export-with-assignment: Replace instances of export VAR=VAL with VAR=VAL; export VAR
2 parents de4c601 + 3addc94 commit c579f53

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

git-clone.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ cleanup() {
229229
trap cleanup 0
230230
mkdir -p "$dir" && D=$(cd "$dir" && pwd) || usage
231231
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
233233
if test yes = "$bare" || test -n "$GIT_WORK_TREE"; then
234234
GIT_DIR="$D"
235235
else

git-filter-branch.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@ set_ident () {
6666
h
6767
s/^'$lid' \([^<]*\) <[^>]*> .*$/\1/
6868
s/'\''/'\''\'\'\''/g
69-
s/.*/export GIT_'$uid'_NAME='\''&'\''/p
69+
s/.*/GIT_'$uid'_NAME='\''&'\''; export GIT_'$uid'_NAME/p
7070
7171
g
7272
s/^'$lid' [^<]* <\([^>]*\)> .*$/\1/
7373
s/'\''/'\''\'\'\''/g
74-
s/.*/export GIT_'$uid'_EMAIL='\''&'\''/p
74+
s/.*/GIT_'$uid'_EMAIL='\''&'\''; export GIT_'$uid'_EMAIL/p
7575
7676
g
7777
s/^'$lid' [^<]* <[^>]*> \(.*\)$/\1/
7878
s/'\''/'\''\'\'\''/g
79-
s/.*/export GIT_'$uid'_DATE='\''&'\''/p
79+
s/.*/GIT_'$uid'_DATE='\''&'\''; export GIT_'$uid'_DATE/p
8080
8181
q
8282
}
8383
'
8484

8585
LANG=C LC_ALL=C sed -ne "$pick_id_script"
8686
# 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"
8888
}
8989

9090
USAGE="[--env-filter <command>] [--tree-filter <command>] \
@@ -206,7 +206,8 @@ done < "$tempdir"/backup-refs
206206
ORIG_GIT_DIR="$GIT_DIR"
207207
ORIG_GIT_WORK_TREE="$GIT_WORK_TREE"
208208
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
210211

211212
# These refs should be updated if their heads were rewritten
212213

@@ -231,7 +232,8 @@ done > "$tempdir"/heads
231232
test -s "$tempdir"/heads ||
232233
die "Which ref do you want to rewrite?"
233234

234-
export GIT_INDEX_FILE="$(pwd)/../index"
235+
GIT_INDEX_FILE="$(pwd)/../index"
236+
export GIT_INDEX_FILE
235237
git read-tree || die "Could not seed the index"
236238

237239
ret=0
@@ -267,7 +269,8 @@ while read commit parents; do
267269
git read-tree -i -m $commit:"$filter_subdir"
268270
esac || die "Could not initialize the index"
269271

270-
export GIT_COMMIT=$commit
272+
GIT_COMMIT=$commit
273+
export GIT_COMMIT
271274
git cat-file commit "$commit" >../commit ||
272275
die "Cannot read commit $commit"
273276

@@ -401,7 +404,8 @@ if [ "$filter_tag_name" ]; then
401404

402405
[ -f "../map/$sha1" ] || continue
403406
new_sha1="$(cat "../map/$sha1")"
404-
export GIT_COMMIT="$sha1"
407+
GIT_COMMIT="$sha1"
408+
export GIT_COMMIT
405409
new_ref="$(echo "$ref" | eval "$filter_tag_name")" ||
406410
die "tag name filter failed: $filter_tag_name"
407411

git-quiltimport.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
7777
}
7878

7979
# 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
8283
while test -z "$GIT_AUTHOR_EMAIL" && test -z "$GIT_AUTHOR_NAME" ; do
8384
if [ -n "$quilt_author" ] ; then
8485
GIT_AUTHOR_NAME="$quilt_author_name";
@@ -104,8 +105,9 @@ for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
104105
GIT_AUTHOR_EMAIL="$patch_author_email"
105106
fi
106107
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
109111
if [ -z "$SUBJECT" ] ; then
110112
SUBJECT=$(echo $patch_name | sed -e 's/.patch$//')
111113
fi

0 commit comments

Comments
 (0)