From 4374c76dfb23a73d37ea8f8076b70feb8842d1fb Mon Sep 17 00:00:00 2001 From: tan Date: Fri, 20 Jun 2025 14:51:29 +0530 Subject: [PATCH 1/2] fix return value of gittreesha `gittreesha` should return a tuple of the sha and error message. A bug introduced in #449 returned only the sha when there was no error. This fixes the bug and also updates the tests --- src/webui/gitutils.jl | 2 +- test/webui/gitutils.jl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/webui/gitutils.jl b/src/webui/gitutils.jl index 13b52a8850..4c4b8e73d0 100644 --- a/src/webui/gitutils.jl +++ b/src/webui/gitutils.jl @@ -262,7 +262,7 @@ function gettreesha( run(Cmd(Cmd(String["git", "clone", "--bare", string(url), dest]); env)) end # let Cmd interpolate strings safely - readchomp(Cmd(String["git", "-C", dest, "rev-parse", "$ref:$subdir"])) + readchomp(Cmd(String["git", "-C", dest, "rev-parse", "$ref:$subdir"])), "" end catch ex @error "Exception while getting tree SHA" exception=(ex, catch_backtrace()) diff --git a/test/webui/gitutils.jl b/test/webui/gitutils.jl index 6b8f47cac7..e81adeff53 100644 --- a/test/webui/gitutils.jl +++ b/test/webui/gitutils.jl @@ -17,10 +17,11 @@ restoreconfig!() org = GitHub.User(login="JuliaLang") public_repo_of_org = GitHub.Repo(name="Example.jl", private=false, owner=org, organization=org, permissions = GitHub.Permissions(admin = true, push = false, pull = true), clone_url="https://github.com/JuliaLang/Example.jl.git") - example_master_treesha = Base.redirect_stderr(devnull) do + example_master_treesha, err = Base.redirect_stderr(devnull) do Registrator.WebUI.gettreesha(public_repo_of_org, "master", "") end @test length(example_master_treesha) == 40 + @test err == "" ret, err = Base.redirect_stderr(devnull) do Registrator.WebUI.gettreesha(public_repo_of_org, "mas ter", "") From b2f80993693776a023a90b5da433a1079f179b9e Mon Sep 17 00:00:00 2001 From: tan Date: Fri, 20 Jun 2025 14:58:32 +0530 Subject: [PATCH 2/2] bump patch version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ef1b4eb108..f6ec426614 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Registrator" uuid = "4418983a-e44d-11e8-3aec-9789530b3b3e" authors = ["Stefan Karpinski "] -version = "1.9.5" +version = "1.9.6" [deps] AutoHashEquals = "15f4f7f2-30c1-5605-9d31-71845cf9641f"