public virtual void TestExecutableRetention() { StoredConfig config = ((FileBasedConfig)db.GetConfig()); config.SetBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_FILEMODE , true); config.Save(); FS executableFs = new _FS_605(); Git git = Git.Open(db.Directory, executableFs); string path = "a.txt"; WriteTrashFile(path, "content"); git.Add().AddFilepattern(path).Call(); RevCommit commit1 = git.Commit().SetMessage("commit").Call(); TreeWalk walk = TreeWalk.ForPath(db, path, commit1.Tree); NUnit.Framework.Assert.IsNotNull(walk); NUnit.Framework.Assert.AreEqual(FileMode.EXECUTABLE_FILE, walk.GetFileMode(0)); FS nonExecutableFs = new _FS_645(); config = ((FileBasedConfig)db.GetConfig()); config.SetBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_FILEMODE , false); config.Save(); Git git2 = Git.Open(db.Directory, nonExecutableFs); WriteTrashFile(path, "content2"); git2.Add().AddFilepattern(path).Call(); RevCommit commit2 = git2.Commit().SetMessage("commit2").Call(); walk = TreeWalk.ForPath(db, path, commit2.Tree); NUnit.Framework.Assert.IsNotNull(walk); NUnit.Framework.Assert.AreEqual(FileMode.EXECUTABLE_FILE, walk.GetFileMode(0)); }