aboutsummaryrefslogtreecommitdiffstats
path: root/identity/identity_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-11-08 23:56:32 +0100
committerMichael Muré <batolettre@gmail.com>2021-02-14 12:17:47 +0100
commitb01aa18d3925a23ba0ad32a322617de7dc9a299e (patch)
treeefb1ab12812d0dbf91609f0647060d713c9ba058 /identity/identity_test.go
parentab57d74a312f325b9d889752aa92c00c395de20f (diff)
downloadgit-bug-b01aa18d3925a23ba0ad32a322617de7dc9a299e.tar.gz
identity: PR fixes
Diffstat (limited to 'identity/identity_test.go')
-rw-r--r--identity/identity_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/identity/identity_test.go b/identity/identity_test.go
index 36d07be6..ad8317ce 100644
--- a/identity/identity_test.go
+++ b/identity/identity_test.go
@@ -204,6 +204,16 @@ func TestMetadata(t *testing.T) {
assertHasKeyValue(t, loaded.ImmutableMetadata(), "key1", "value1")
assertHasKeyValue(t, loaded.MutableMetadata(), "key1", "value2")
+
+ // set metadata after commit
+ versionCount := len(identity.versions)
+ identity.SetMetadata("foo", "bar")
+ require.True(t, identity.NeedCommit())
+ require.Len(t, identity.versions, versionCount+1)
+
+ err = identity.Commit(repo)
+ require.NoError(t, err)
+ require.Len(t, identity.versions, versionCount+1)
}
func assertHasKeyValue(t *testing.T, metadata map[string]string, key, value string) {