diff options
author | Michael Muré <batolettre@gmail.com> | 2020-11-08 23:56:32 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2021-02-14 12:17:47 +0100 |
commit | b01aa18d3925a23ba0ad32a322617de7dc9a299e (patch) | |
tree | efb1ab12812d0dbf91609f0647060d713c9ba058 /identity/identity_test.go | |
parent | ab57d74a312f325b9d889752aa92c00c395de20f (diff) | |
download | git-bug-b01aa18d3925a23ba0ad32a322617de7dc9a299e.tar.gz |
identity: PR fixes
Diffstat (limited to 'identity/identity_test.go')
-rw-r--r-- | identity/identity_test.go | 10 |
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) { |