If branch has been renamed, users are unable to use plastic

This is a regression of an old bug wherein if a branch was deleted or renamed and another user was on it, the user can’t perform operations anymore

Attempting to switch a commit or branch in my GUI client gives me a dialog saying “An unexpected error has occurred.”:

On the command line a switch gives the following output:

> cm switch cs:10303
Searching for changed items in the workspace...
Error: Object reference not set to an instance of an object.

Refreshing in pending changes does this:

My solution to this is very low level and I have to edit the .plastic/plastic.selector file directly and change smartbranch to the new name. I’m assuming changing this to /main or something in the case of a deleted branch would at least allow the tooling to work well enough to get back to a good commit (though I haven’t tried it)

Allowing another user to perform operations that completely wedge users is less than ideal.

3 Likes

I’m also experiencing a similar issue were i am trying to commit/shelve to move to another branch and it just keeps coming up with a ‘no checkout branch found’.

Hi,

I’m afraid it is not possible to workaround that issue unless you modify the “.plastic” folder for the workspace and make it point to an existing Branch/Changeset.
We can help you with that if you write an e-mail to us at devops-vcs-support@unity3d.com with the details.

I’m really sorry for the inconvenience.

Best,
Héber.

I just had to resolve this issue with a colleague, many thanks to Mortis for the fix!

Renaming of a branch really shouldn’t cause this unrecoverable state within the UI. At the very least, if the Unity doesn’t recognise the current branch listed in that file, there should be a handler to reset to a different/master branch instead. Ideally, renaming the branch should also properly update other clients in the same repository immediately / on their next refresh.

2 Likes