File tree 3 files changed +20
-5
lines changed
3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ set-dds-env.sh
3
3
token
4
4
git-issue.pdf
5
5
git-issue.ps
6
+ git-issue
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ USAGE_new_EOF
222
222
223
223
sub_init ()
224
224
{
225
- local existing
225
+ local existing username useremail
226
226
227
227
while getopts e flag ; do
228
228
case $flag in
@@ -238,6 +238,8 @@ sub_init()
238
238
239
239
test -d .issues && error ' An .issues directory is already present'
240
240
mkdir .issues || error ' Unable to create .issues directory'
241
+ username=` git config --local user.name`
242
+ useremail=` git config --local user.email`
241
243
cdissues
242
244
if ! [ " $existing " ] ; then
243
245
git init -q || error ' Unable to initialize Git directory'
@@ -273,6 +275,12 @@ This is an distributed issue tracking repository based on Git.
273
275
Visit [git-issue](https://github.com/dspinellis/git-issue) for more information.
274
276
EOF
275
277
git add config README.md templates/comment templates/description
278
+ if [ -n " $username " ] ; then
279
+ git config --local user.name " $username "
280
+ fi
281
+ if [ -n " $useremail " ] ; then
282
+ git config --local user.email " $useremail "
283
+ fi
276
284
commit ' gi: Initialize issues repository' ' gi init'
277
285
echo " Initialized empty issues repository in $( pwd) "
278
286
}
@@ -951,7 +959,7 @@ sub_edit()
951
959
;;
952
960
esac
953
961
done
954
-
962
+
955
963
shift $(( OPTIND - 1 )) ;
956
964
test -n " $1 " || usage_edit
957
965
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ TopDir=$(mktemp -d)
161
161
} 1>&2
162
162
163
163
if command -v gdate ; then
164
- DATEBIN=" gdate"
164
+ DATEBIN=" gdate"
165
165
else
166
166
DATEBIN=" date"
167
167
fi
@@ -199,10 +199,16 @@ cd "$TopDir"
199
199
200
200
mkdir testdir
201
201
cd testdir
202
+ git init > /dev/null 2>&1 ;
203
+ git config --local user.name " Joe"
204
+ git config --local user.email " joe@example.com"
205
+ echo " .issues" > .gitignore
202
206
203
207
try " $gi " init
204
208
try " $gi " list
205
209
210
+ start ; ( cd .issues; git config --local user.name ) | try_grep " Joe"
211
+ start ; ( cd .issues; git config --local user.email ) | try_grep " joe@example.com"
206
212
start ; " $gi " list " $issue " | try_ngrep .
207
213
208
214
# New
@@ -517,11 +523,11 @@ else
517
523
start ; " $gi " show -c " $rissue " | try_grep ' ^ *comment 1 line 2'
518
524
start ; " $gi " show -c " $rissue " | try_grep ' ^ *comment 2'
519
525
start ; " $gi " show -c " $rissue " | try_grep ' ^ *comment 4'
520
-
526
+
521
527
start ; " $gi " show " $rissue2 " | try_grep ' ^Milestone: ver4'
522
528
rissue3=$( " $gi " list | awk ' /An open issue on GitHub with assignees and tags/ {print $1}' )
523
529
start ; " $gi " show " $rissue3 " | try_grep ' good first issue'
524
-
530
+
525
531
cd ../testdir
526
532
527
533
# delete repo
You can’t perform that action at this time.
0 commit comments