Skip to content

Commit 799dfc4

Browse files
committed
fix #2 handle upstream projects/forks
1 parent 63a4895 commit 799dfc4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/App/TimeTracker/Command/GitHub.pm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ sub _build_github_client {
4141
# optional
4242
$args{api_uri} = $config->{api_uri} if $config->{api_uri};
4343

44+
if ( $config->{upstream} ) {
45+
for my $fld (qw(user repo)) {
46+
error_message( "You set upstream, but did not set '" . $fld . "'!" )
47+
unless $config->{upstream}->{$fld};
48+
$args{$fld} = $config->{upstream}->{$fld};
49+
}
50+
}
51+
4452
return Pithub->new(%args);
4553
}
4654

@@ -185,6 +193,15 @@ Optional.
185193
186194
Set this to the URL of your local GitHub Enterprise installation.
187195
196+
=head3 upstream
197+
198+
Optional.
199+
200+
If the project you are working on has an upstream project where issues are
201+
handled, then you can set upstream to a hash of user and repo (like on a normal
202+
project) to fetch issues from there.
203+
204+
188205
=head1 NEW COMMANDS
189206
190207
No new commands

0 commit comments

Comments
 (0)