File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Expand file tree Collapse file tree 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
33token
44git-issue.pdf
55git-issue.ps
6+ git-issue
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ USAGE_new_EOF
222222
223223sub_init ()
224224{
225- local existing
225+ local existing username useremail
226226
227227 while getopts e flag ; do
228228 case $flag in
@@ -238,6 +238,8 @@ sub_init()
238238
239239 test -d .issues && error ' An .issues directory is already present'
240240 mkdir .issues || error ' Unable to create .issues directory'
241+ username=` git config --local user.name`
242+ useremail=` git config --local user.email`
241243 cdissues
242244 if ! [ " $existing " ] ; then
243245 git init -q || error ' Unable to initialize Git directory'
@@ -273,6 +275,12 @@ This is an distributed issue tracking repository based on Git.
273275Visit [git-issue](https://github.com/dspinellis/git-issue) for more information.
274276EOF
275277 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
276284 commit ' gi: Initialize issues repository' ' gi init'
277285 echo " Initialized empty issues repository in $( pwd) "
278286}
@@ -951,7 +959,7 @@ sub_edit()
951959 ;;
952960 esac
953961 done
954-
962+
955963 shift $(( OPTIND - 1 )) ;
956964 test -n " $1 " || usage_edit
957965
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ TopDir=$(mktemp -d)
161161} 1>&2
162162
163163if command -v gdate ; then
164- DATEBIN=" gdate"
164+ DATEBIN=" gdate"
165165else
166166 DATEBIN=" date"
167167fi
@@ -199,10 +199,16 @@ cd "$TopDir"
199199
200200mkdir testdir
201201cd testdir
202+ git init > /dev/null 2>&1 ;
203+ git config --local user.name " Joe"
204+ git config --local user.email
" [email protected] " 205+ echo " .issues" > .gitignore
202206
203207try " $gi " init
204208try " $gi " list
205209
210+ start ; ( cd .issues; git config --local user.name ) | try_grep " Joe"
211+ start
; (
cd .issues
; git config --local user.email )
| try_grep
" [email protected] " 206212start ; " $gi " list " $issue " | try_ngrep .
207213
208214# New
@@ -517,11 +523,11 @@ else
517523 start ; " $gi " show -c " $rissue " | try_grep ' ^ *comment 1 line 2'
518524 start ; " $gi " show -c " $rissue " | try_grep ' ^ *comment 2'
519525 start ; " $gi " show -c " $rissue " | try_grep ' ^ *comment 4'
520-
526+
521527 start ; " $gi " show " $rissue2 " | try_grep ' ^Milestone: ver4'
522528 rissue3=$( " $gi " list | awk ' /An open issue on GitHub with assignees and tags/ {print $1}' )
523529 start ; " $gi " show " $rissue3 " | try_grep ' good first issue'
524-
530+
525531 cd ../testdir
526532
527533 # delete repo
You can’t perform that action at this time.
0 commit comments