diff options
author | Rafael Ascensão <rafa.almas@gmail.com> | 2018-12-10 20:55:08 +0000 |
---|---|---|
committer | Rafael Ascensão <rafa.almas@gmail.com> | 2018-12-10 22:14:27 +0000 |
commit | 8dcd3d21cd5e1bf0312225a0db9506173ea76fc7 (patch) | |
tree | b4d60d3208917c02f95a8808d893aa42ca7b203b /commands/select | |
parent | 2ac2c8812ff343d2c4cade00d6ea17339d329fa8 (diff) | |
download | git-bug-8dcd3d21cd5e1bf0312225a0db9506173ea76fc7.tar.gz |
tests: configure user ident in repos used by tests
Some git operations require the user to have an identity configured and
will exit with failure if none is set (or if git can't guess it). As a
direct consequence of this, the test suite may fail depending on the
user local configuration.
The error itself is justified as regular users *should* configure their
identity themselves. However, when building in chrooted environments
it's unlikely the git identity will be set making the test suite fail
unnecessarily.
To prevent such unnecessary failures, let's make a dummy identity for
repos created and used by the test suite.
Diffstat (limited to 'commands/select')
-rw-r--r-- | commands/select/select_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/commands/select/select_test.go b/commands/select/select_test.go index 79c8cbf0..fe501d76 100644 --- a/commands/select/select_test.go +++ b/commands/select/select_test.go @@ -96,6 +96,13 @@ func createRepo() *repository.GitRepo { log.Fatal(err) } + if err := repo.StoreConfig("user.name", "testuser"); err != nil { + log.Fatal("failed to set user.name for test repository: ", err) + } + if err := repo.StoreConfig("user.email", "testuser@example.com"); err != nil { + log.Fatal("failed to set user.email for test repository: ", err) + } + return repo } |