@@ -40,19 +40,20 @@ class Hierarchy {
4040
4141 cacheContributors ( files , commitAuthors ) {
4242 return Promise . each ( files , file => {
43- return execute ( `git --no-pager log --follow --no-merges --format="%H" "${ file . path } "` , this . path , { stdout : null } )
44- . then ( stdout => {
45- const output = stdout . toString ( ) . replace ( / \n $ / , '' ) ;
46- const shas = output . split ( '\n' ) . reverse ( ) ;
47- const contributors = [ ] ;
48- for ( const sha of shas ) {
49- const author = commitAuthors [ sha ] ;
50- if ( author && ! contributors . find ( contributor => contributor . login === author . login ) ) {
51- contributors . push ( author ) ;
52- }
43+ return execute ( `git --no-pager log --follow --no-merges --format="%H" "${ file . path } "` , {
44+ cwd : this . path , stdout : null ,
45+ } ) . then ( stdout => {
46+ const output = stdout . toString ( ) . replace ( / \n $ / , '' ) ;
47+ const shas = output . split ( '\n' ) . reverse ( ) ;
48+ const contributors = [ ] ;
49+ for ( const sha of shas ) {
50+ const author = commitAuthors [ sha ] ;
51+ if ( author && ! contributors . find ( contributor => contributor . login === author . login ) ) {
52+ contributors . push ( author ) ;
5353 }
54- file . contributors = contributors ;
55- } ) ;
54+ }
55+ file . contributors = contributors ;
56+ } ) ;
5657 } ) ;
5758 }
5859
0 commit comments