]> source.dussan.org Git - jgit.git/commit
Use FileSnapshot without using configs for FileBasedConfig 76/189176/9 stable-5.1
authorLuca Milanesio <luca.milanesio@gmail.com>
Tue, 28 Dec 2021 23:53:35 +0000 (23:53 +0000)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 30 Dec 2021 10:14:47 +0000 (11:14 +0100)
commitfed0ab9baad30a58bfae30ce8b45e5ba3b1b1a10
treecc060c190885b653ab319fd686d8d0536962cb73
parent7828ef349cfb671cf9673d766a420c032d7ffb45
Use FileSnapshot without using configs for FileBasedConfig

FileBasedConfig should not rely on auto-detection of
the file-snapshot attribute computation based on config.

The check was already performed when a new FileBasedConfig
is created at L158:

// don't use config in this snapshot to avoid endless recursion
newSnapshot = FileSnapshot.saveNoConfig(getFile());

The check was missing though when the FileBasedConfig is saved
to disk and the new snapshot is obtained from the associated
LockFile.

This change fixes the issue by keeping a non-config based
FileSnapshot also after a FileBasedConfig is saved.

Bug: 577983
Change-Id: Id1e410ba687e683ff2b2643af31e1110b103b356
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java