From 02458785b93094dfc65b31a4ecf2a8e690143b03 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 13 Feb 2018 23:12:23 +0300 Subject: Assume git repo URL fragment of 40 hex digits is a commit id --- tests/repository-location/driver.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/repository-location') diff --git a/tests/repository-location/driver.cxx b/tests/repository-location/driver.cxx index e5a818a..ad3b0dd 100644 --- a/tests/repository-location/driver.cxx +++ b/tests/repository-location/driver.cxx @@ -754,16 +754,16 @@ namespace bpkg // Repository URL fragments. // { - loc ("https://www.example.com/test.git#master", repository_type::git); - loc ("https://www.example.com/test.git#master@", repository_type::git); + string branch ("master"); + string commit ("0a53e9ddeaddad63ad106860237bbf53411d11a7"); - loc ("https://www.example.com/test.git#" - "@0a53e9ddeaddad63ad106860237bbf53411d11a7", - repository_type::git); + assert (*git_reference (branch).branch == branch); + assert (*git_reference (commit + "@").branch == commit); + assert (*git_reference (commit).commit == commit); + assert (*git_reference ("@" + commit).commit == commit); - loc ("https://www.example.com/test.git#" - "master@0a53e9ddeaddad63ad106860237bbf53411d11a7", - repository_type::git); + git_reference r (branch + "@" + commit); + assert (*r.branch == branch && *r.commit == commit); } // repository_url -- cgit v1.1