RFR: Query GitHub for current user when using PAT

Erik Helin ehelin at openjdk.org
Tue Nov 19 14:22:58 UTC 2019

Hi all,

please review this patch that queries GitHub for the current user when using a PAT as credentials with `GitHubHost.java`. The reason for this is that some credentials manager, in particular Git Credential Manager on Windows, always seems to return "PersonalAccessToken" as the username when calling `git credential fill`. The fix is simple, just query the [/user](https://developer.github.com/v3/users/#get-the-authenticated-user) endoint instead of [/users](https://developer.github.com/v3/users/#get-a-single-user).


## Testing
- Manual testing with `git pr` and PAT on Linux x64 _with_ a bogus username in credential store.


 - 6a472c74: Query GitHub for current user when using PAT

Changes: https://git.openjdk.java.net/skara/pull/258/files
 Webrev: https://webrevs.openjdk.java.net/skara/258/webrev.00
  Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/skara/pull/258.diff
  Fetch: git fetch https://git.openjdk.java.net/skara pull/258/head:pull/258

PR: https://git.openjdk.java.net/skara/pull/258

More information about the skara-dev mailing list