Skip to content

git-submodule handling of branch changes #49

Closed
@Byron

Description

@Byron

When the submodule update detects a branch-change, it seems that it tries to remove the branch it has checked out before switching to the new branch, which obviously fails as the currently checked-out branch cannot be deleted. Apparently it tries to clean up, without noticing that it tries to clean up its own branch - it seems to make incorrect assumptions.

Additionally, it should have fetched/updated the submodule before trying to do anything with the paths, as this can trigger new branches to come in (and that you want to switch to subsequently).

To make things crazier: if you tried to help it to get along, it will manage to delete its source branch, but as it still sees the change and tries to switch to a new branch, it will do all the wrong things and try to work with a non-existing branch (the one it deleted).

Changing branch of submodule 'shotgun_events_0.9' from refs/heads/0.9 to refs/heads/custom
GitCommandError: 'git cherry origin/0.9 0.9' returned exit status 128: fatal: Unknown commit 0.9

NOTE: it seems to help if the --to-latest-revision flag is given. However, I would expect it to be clearer when it tries to do what. The -n flag might help here as well.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions