Merge pull request '修复 Kubernetes 工作区无法保存 Git 版本' (#18) from codex/fix-workspace-git-ownership into main
Verify control plane / verify (push) Canceled after 0s

Reviewed-on: http://git.xhmcl.com/xhgit/webup-cloud/pulls/18
This commit was merged in pull request #18.
This commit is contained in:
xhgit committed 2026-11-09 15:24:29 +00:00
commit 318b7d8086
2 files changed
+30 -4

No files matched your search

+13
View File
@@ -41,6 +41,19 @@ class GatewayTests(unittest.TestCase):
(root / "large.txt").write_bytes(b"x" * 64001)
self.assertIn("error", self.execute_file_tool(root, "read_file", {"path": "large.txt"}))
def test_git_history_distinguishes_empty_failed_and_saved_versions(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
self.assertEqual([], self.execute_file_tool(root, "version_list", {})["versions"])
subprocess.run(["git", "init"], cwd=root, check=True, capture_output=True)
self.assertEqual([], self.execute_file_tool(root, "version_list", {})["versions"])
(root / "index.html").write_text("<h1>Versioned source</h1>")
saved = self.execute_file_tool(root, "version_save", {"message": "Initial version"})
self.assertEqual("Initial version", saved["versions"][0]["message"])
self.assertEqual(saved, self.execute_file_tool(root, "version_list", {}))
(root / ".git/config").write_text("[invalid")
self.assertEqual("Git history unavailable", self.execute_file_tool(root, "version_list", {})["error"])
def test_source_snapshot_checks_start_and_excludes_credentials_and_local_data(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)