metacello icon indicating copy to clipboard operation
metacello copied to clipboard

Unable to reference to git branch name containing slash in baseline/scripting API

Open LinqLover opened this issue 3 years ago • 1 comments

I have a repository with a branch of the form feat/foo and was trying to reference it from another baseline using the common syntax:

spec repository: 'github://LinqLover/my-repo:feat/foo/packages'.

But this cannot work because this is interpreted as: branch = 'feat' + path = 'foo/packages'.

The relevant logic is in MCGitBasedNetworkRepository class >> #parseLocation:version:. A possible fix could be to support simple escaping in a form such as:

spec repository: 'github://LinqLover/my-repo:feat\/foo/packages'.

Another form of escaping might be an enclosing character for the entire branch name, but since different brackets and quotes are all legal characters for branch names[1], backslash-escaping would probably be the simplest possible way.

@dalehenrich Would you agree with this solution approach? Maybe I could find some time to patch the location parsing soon. :-)

[1] https://stackoverflow.com/a/3651867/13994294

LinqLover avatar May 26 '21 12:05 LinqLover

Ah, I just discovered #234 ... Apparently this fix only works if the repository path is explicitly specified, which was not the case in my example.

LinqLover avatar May 26 '21 19:05 LinqLover