Back port cukes from v1.12.3

v2.2.0 doesn’t have the bug https://github.com/github/hub/commit/bc4b450b613ba9a79f71ccb3246d87f8e99a1b00 but back porting the cukes in case there’ll be regression for v2.2.0.
Merge pull request #742 from github/cuke_from_1_12_3

Back port cukes from v1.12.3