Skip to content

fix: git remote: change url instead of rm / add#81

Merged
sbidoul merged 1 commit into
acsone:masterfrom
akretion:fix-branch-rename
Jun 4, 2024
Merged

fix: git remote: change url instead of rm / add#81
sbidoul merged 1 commit into
acsone:masterfrom
akretion:fix-branch-rename

Conversation

@hparfr

@hparfr hparfr commented Apr 9, 2024

Copy link
Copy Markdown
Contributor

With some repos, there is an issue when the origin url is changed to a fork in repo.yml.

Errors look like unable to read sha1 file of, index-pack failed

It's occuring when the remote is removed (git remote rm origin) then added back with another url (git remote add origin ).

With this fix, we change the url inplace. git remote set-url origin <new url>

With some repos, there is an issue when the origin url is changed
to a fork in repo.yml.

Errors look like `unable to read sha1 file of`, `index-pack failed`

It's occuring when the remote is removed (git remote rm origin) then
added back with another url (git remote add origin <new url>).

With this fix, we change the url inplace. `git remote set-url origin <new url>`
@hparfr

hparfr commented Apr 9, 2024

Copy link
Copy Markdown
Contributor Author

My test file is:

./external-src/pattern-import-export:
  merges:
  - origin 16.0-mig-pattern-import-export2
  remotes:
    origin: https://github.com/akretion/pattern-import-export
  target: origin 16.0-mig-pattern-import-export2

then replaced by (the order is important):

./external-src/pattern-import-export:
  merges:
  - origin 16.0
  remotes:
    origin: https://github.com/shopinvader/pattern-import-export
  target: origin 16.0

@lmignon lmignon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems logic... (Code review)

@hparfr

hparfr commented Jun 3, 2024

Copy link
Copy Markdown
Contributor Author

@sbidoul please

@sbidoul
sbidoul merged commit 63f2ca1 into acsone:master Jun 4, 2024
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.

3 participants