#1010751 clone: handle -b optional branch specification in VCS-Git

#1010751#5
Date:
2022-05-08 15:21:15 UTC
From:
To:
Hello.

https://www.debian.org/doc/debian-policy/ch-controlfields.html#version-control-system-vcs-fields
allows the VCS-Git to specify a branch and a relative path inside a
given repository.

# gbp clone vcs-git:pcscada
gbp:error: Can't find any vcs-git URL for 'pcscada'

The attached patch fixes the branch selection.
It does not allow a relative path.

#1010751#10
Date:
2022-05-28 14:57:51 UTC
From:
To:
Hi,
Thanks, makes sense, some comments:

I think we should always return a tuple and have branch = None when
there's no -b so we can also avoid the isinstance() below. It would also
be great to have a test (e.g. by just having a test that parses some
pre fetched apt output (so we don't need to run it in the tests).
Cheers,
 -- Guido

#1010751#15
Date:
2022-08-18 20:05:53 UTC
From:
To:
Hello.
The attached commit implements your suggestions.

#1010751#20
Date:
2024-02-29 21:49:32 UTC
From:
To:
Ping?
#1010751#25
Date:
2024-03-03 16:28:45 UTC
From:
To:
Hi,

I'll have a look over the next days (I missed your last update).
Cheers,
 -- Guido

#1010751#30
Date:
2024-11-30 16:12:08 UTC
From:
To:
Hello.
A new version is attached, with several unrelated new suggestions.
All tests pass.

#1010751#35
Date:
2026-02-24 02:44:10 UTC
From:
To:
Hello.

0001 seems obsolete.
0002 is improved by IntEnum
0004-6 are improved by NamedTuple, making 0003 unnecessary
All tests pass and mypy is happy.

By the way, the source package differs a lot from the git repository.
It embeds lots of things into tests/component/deb/data/*.
Is this deliberate?