Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not a valid object name when push dot named subrepo #583

Open
xiaoyao9184 opened this issue May 22, 2023 · 6 comments
Open

Not a valid object name when push dot named subrepo #583

xiaoyao9184 opened this issue May 22, 2023 · 6 comments

Comments

@xiaoyao9184
Copy link

xiaoyao9184 commented May 22, 2023

I used a directory name with a dot '.', which usually can't be used in a branch name,
I tried using git subrepo init and it worked,
but when I did a git subrepo push it failed,
guessing because of the dot name , the same git repo branch also fails.

git-subrepo: Command failed: 'git branch subrepo/%2eseed '.
fatal: Not a valid object name: ''.
git-subrepo Version: 0.4.5
Copyright 2013-2020 Ingy döt Net
https://github.com/ingydotnet/git-subrepo
/home/xy/git-subrepo/lib/git-subrepo
Git Version: 2.30.2
@artem-sidorenko
Copy link

I have the same issue using git subrepo pull. When I execute the git branch command directly - it works just fine

@artem-sidorenko
Copy link

it looks like it should be resolved by PR #498

@xiaoyao9184
Copy link
Author

After re-init and clone, I found that it was actually because the rebase changed the commit id and the .gitrepo file not same.

@jcalfee
Copy link

jcalfee commented Jun 16, 2023

Work around? I rebased the master branch and I can push one subrepo, but 3 other nested subrepo's under that one all fail with this error. All subrepos are in rebase mode.

related: #503 (comment)

@tennox
Copy link

tennox commented Jan 9, 2024

Workaround

  1. commit all changes
  2. create a branch: git checkout -b subrepo-fix
  3. delete subrepo: rm -rf subrepo/
  4. re-clone: git subrepo clone [email protected]:org/subrepo.git subrepo/
  5. Check for differences in repo state: git diff main (optimally, only subrepo/.gitrepo is different)

If you had changes in the parent repo that are not reset to subrepo state

Reset the files to the state on the main branch: git checkout main -- subrepo/file.txt (be sure not to reset .gitrepo)

Example: my MR

@taktran
Copy link

taktran commented Apr 17, 2024

I found a potential fix for this issue here: #617

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

No branches or pull requests

5 participants