Skip to content

scripts/get_git: clean cached submodule dir on retry#2970

Open
felixjones wants to merge 1 commit into
ROCKNIX:nextfrom
felixjones:fejones/get_git
Open

scripts/get_git: clean cached submodule dir on retry#2970
felixjones wants to merge 1 commit into
ROCKNIX:nextfrom
felixjones:fejones/get_git

Conversation

@felixjones

Copy link
Copy Markdown

Summary

Cloning a submodule whose pinned commit is not the tip of its default branch leaves a shallow git dir with --shallow-submodules that ends up breaking fetches of that commit (git fails with 'upload-pack: not our ref').

Removing the cached .git/modules entry and the directory before reinit performs a clean full clone that resolves the pinned commit

Testing

I encountered this 'upload-pack: not our ref' when experimenting with gamescope, which pins wlroots to a commit on a non-default branch - I was deleting the cached .git/modules/ directory over and over and I figured if it's in this Failed branch it's safe to delete .git/modules/${submodule}

Additional Context

It could be that I suck at git and got into this broken state myself, but it was consistent when I was messing around with gamescope


AI Usage

NO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant