summaryrefslogtreecommitdiffstats
path: root/tests/test_git_command.py
Commit message (Collapse)AuthorAgeFilesLines
* repo: raise min version of gitMike Frysinger2020-02-051-1/+1
| | | | | | | | | | | | The git-2.10 series was released in 2016. Since we're moving to require Python 3.6 which was also released in 2016, bumping up the git version seems reasonable. Also we don't really test any git versions close to as old as 1.7.2 which was released in 2010. Change-Id: Ib71b714de6cd0b7dd50d0b300b108a560ee27331 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253134 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* git_command: set GIT_HTTP_USER_AGENT on all requestsMike Frysinger2019-10-011-0/+8
| | | | | | | | | | | | | | | | | We've been setting the User-Agent header when making connections from repo itself, but not when running git (as the latter will set up User-Agent itself). Our Gerrit/Git admins say it'll be helpful if we pass through the repo version settings even when running git. We currently set GIT_HTTP_USER_AGENT and not GIT_USER_AGENT as it's unclear if the extended form works over all protocols. We can wait for a user request. Bug: https://crbug.com/gerrit/11144 Change-Id: I21d293f49534058dbc23225152451df26c5b7bef Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/239233 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* git_command: refactor User-Agent settingsMike Frysinger2019-10-011-5/+13
| | | | | | | | | | | | | | | Convert the RepoUserAgent function into a UserAgent class. This makes it cleaner to hold internal state, and will make it easier to add a separate git User-Agent, although we don't do it here. We make the RepoSourceVersion independent of GitCommand so that it can be called by the class (later). Bug: https://crbug.com/gerrit/11144 Change-Id: Iab4e1f974b8733a36b243b2d03f5085a96effa19 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/239232 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* move UserAgent to git_command for wider userMike Frysinger2019-10-011-0/+13
| | | | | | | | | | | We can't import the main module, so move the UserAgent helper out of it and into the git_command module so it can be used in more places. Bug: https://crbug.com/gerrit/11144 Change-Id: I8093c8a20bd1dc7d612d0e2a85180341817c0d86 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/231057 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* tests: add docstrings & print_function (for Python 3)Mike Frysinger2019-08-011-0/+4
| | | | | | | | Bug: https://crbug.com/gerrit/10418 Change-Id: Id98183597a9b0201ca98ec0bf5033a5f5ac6bda2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/232892 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* git_command: drop custom version helperMike Frysinger2019-07-111-0/+45
Since ParseGitVersion can call `git --version` automatically, we don't need this duplicate version() helper anymore. The only other user is the `repo version` code, so convert that to version_tuple().full. Bug: https://crbug.com/gerrit/11144 Change-Id: I9d77822fc39f4ba28884d9183359169cabf5f17d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/231055 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>