[squeak-dev] GitReference class >> validateReferenceName

Jakob Reschke forums.jakob at resfarm.de
Sat Oct 3 14:10:39 UTC 2020


Hi Timothy,

Thank you for the report. When did you install the Git Browser in this
image? I published a new version on September 26th that should fix the
issue. If you did not install it after that, please update and try
again: in the window menu of the Git Browser (the third window button
next to expand and collapse), choose "self-update".

Kind regards,
Jakob

Am Sa., 3. Okt. 2020 um 15:46 Uhr schrieb gettimothy via Squeak-dev
<squeak-dev at lists.squeakfoundation.org>:
>
> Hi folks,
>
> messing about with the new-fangled git stuff.
>
> I am 'Add Git remote" thing , click 'ok' and MNU on
>
> Text >>includesSubstring.
>
> I replace aName (which is a Text) with aName string and all works as expected.
>
> validateReferenceName: aName
> "See https://git-scm.com/docs/git-check-ref-format"
>
> | tokens illegalCharacters |
> illegalCharacters := '[?+~^\*: '.
> (aName includesAnyOf: illegalCharacters) ifTrue: [
> GitInvalidReferenceName signal: 'A reference name can not include whitespace or any of the following characters: ' , illegalCharacters.].
> aName isEmpty ifTrue: [GitInvalidReferenceName signal: 'A reference name can not be empty'].
> (aName string includesSubstring: '..') ifTrue: [GitInvalidReferenceName signal: 'A reference name can not include the string ''..'''].
> (aName string ncludesSubstring: '@{') ifTrue: [GitInvalidReferenceName signal: 'A reference name can not include the string ''@{'''].
> (aName string includesSubstring: '//') ifTrue: [GitInvalidReferenceName signal: 'A reference name can not include two consecutive slashes'].
> (aName string first = $/ or: [aName last = $/]) ifTrue: [GitInvalidReferenceName signal: 'A reference name can not start or end with a slash'].
> (aName string endsWith: '@') ifTrue: [GitInvalidReferenceName signal: '''@'' is not a valid reference name'].
>
> tokens := aName string findTokens: '/'.
> (tokens anySatisfy: [:t | (t first = $.) or: [t endsWith: '.lock']]) ifTrue: [
> GitInvalidReferenceName signal: 'A reference component can not start with a dot or end with .lock'].
>
> hth.
>
> btw, books in pillar format (?) for squeakbooks.org/com will be hosted on github eventually and then hopefully auto-published on the website.
>
> hence, the git-tools stuff work.
>
>
>
>


More information about the Squeak-dev mailing list