forked from go-git/go-git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plumbing: packp and server, Include the contents of `GO_GIT_USER_AGEN…
…T_EXTRA` as the git user agent. Fixes go-git#529
- Loading branch information
Showing
5 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package capability | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
check "gopkg.in/check.v1" | ||
) | ||
|
||
var _ = check.Suite(&SuiteCapabilities{}) | ||
|
||
func (s *SuiteCapabilities) TestDefaultAgent(c *check.C) { | ||
os.Unsetenv("GO_GIT_USER_AGENT_EXTRA") | ||
ua := DefaultAgent() | ||
c.Assert(ua, check.Equals, userAgent) | ||
} | ||
|
||
func (s *SuiteCapabilities) TestEnvAgent(c *check.C) { | ||
os.Setenv("GO_GIT_USER_AGENT_EXTRA", "abc xyz") | ||
ua := DefaultAgent() | ||
c.Assert(ua, check.Equals, fmt.Sprintf("%s %s", userAgent, "abc xyz")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters