From a9ca7d47f22b37c43ac97f1f04181fe114f3ce58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 28 Jun 2025 09:16:17 +0200 Subject: Fix extrating subtree hash in a bare repository Changelog: Fix getting (sub)directory in a bare repository --- test/script/repo.et | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'test/script/repo.et') diff --git a/test/script/repo.et b/test/script/repo.et index 7a34a1c..d93f700 100644 --- a/test/script/repo.et +++ b/test/script/repo.et @@ -14,52 +14,76 @@ test RepoSubtree: git -C work rev-parse HEAD:first git -C work rev-parse HEAD:first/second + git clone -q --bare work bare.git + expect /([0-9a-f]+)/ from git_init capture commit expect /([0-9a-f]+)/ from git_init capture root expect /([0-9a-f]+)/ from git_init capture sub1 expect /([0-9a-f]+)/ from git_init capture sub2 - for repo in [ "./work" ]: + for repo in [ "./work", "./bare.git" ]: local: spawn as p on n args [ repo, "subtree", commit, "" ] expect from p /msg $root/ + expect from p /path (.*)/ capture path + guard (path == "") local: spawn as p on n args [ repo, "subtree", commit, "." ] expect from p /msg $root/ + expect from p /path (.*)/ capture path + guard (path == "") local: spawn as p on n args [ repo, "subtree", commit, "/" ] expect from p /msg $root/ + expect from p /path (.*)/ capture path + guard (path == "") local: spawn as p on n args [ repo, "subtree", commit, "first" ] expect from p /msg $sub1/ + expect from p /path (.*)/ capture path + guard (path == "first") local: spawn as p on n args [ repo, "subtree", commit, "./first" ] expect from p /msg $sub1/ + expect from p /path (.*)/ capture path + guard (path == "first") local: spawn as p on n args [ repo, "subtree", commit, "/first" ] expect from p /msg $sub1/ + expect from p /path (.*)/ capture path + guard (path == "first") local: spawn as p on n args [ repo, "subtree", commit, "./first/second" ] expect from p /msg $sub2/ + expect from p /path (.*)/ capture path + guard (path == "first/second") local: spawn as p on n args [ repo, "subtree", commit, "/first/second" ] expect from p /msg $sub2/ + expect from p /path (.*)/ capture path + guard (path == "first/second") local: spawn as p on n args [ repo, "subtree", "$sub1(first)", "second" ] expect from p /msg $sub2/ + expect from p /path (.*)/ capture path + guard (path == "first/second") local: spawn as p on n args [ repo, "subtree", "$sub1(first)", "./second" ] expect from p /msg $sub2/ + expect from p /path (.*)/ capture path + guard (path == "first/second") local: spawn as p on n args [ repo, "subtree", "$sub1(first)", "/second/" ] expect from p /msg $sub2/ + expect from p /path (.*)/ capture path + guard (path == "first/second") -- cgit v1.2.3