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

xrepo add-repo bad error handling #3092

Closed
glcraft opened this issue Nov 21, 2022 · 2 comments
Closed

xrepo add-repo bad error handling #3092

glcraft opened this issue Nov 21, 2022 · 2 comments
Labels
Milestone

Comments

@glcraft
Copy link
Contributor

glcraft commented Nov 21, 2022

Xmake Version

2.7.4

Operating System Version and Architecture

Windows 11 version 22H2

Describe Bug

I executed

xrepo add-repo git@github.com:glcraft/xmake-custom-repo.git master

The program output the following error :

error: fatal: repository 'main' does not exist

error: execv(xmake repo --add --global git@github.com:glcraft/xmake-custom-repo.git main) failed(-1)

But it still add the repo in the repo's list:

PS G:\Projects> xrepo add-repo custom-repo git@github.com:glcraft/xmake-custom-repo.git master
add global repository(custom-repo): git@github.com:glcraft/xmake-custom-repo.git master ok!

PS G:\Projects> xrepo list-repo
global repositories:
    custom-repo git@github.com:glcraft/xmake-custom-repo.git master
    git@github.com:glcraft/xmake-custom-repo.git master
    build-artifacts https://github.com/xmake-mirror/build-artifacts.git main
    xmake-repo https://github.com/xmake-io/xmake-repo.git master
    builtin-repo C:\Users\glitc\xmake\repository

Note the second list in the list

Expected Behavior

If there is an error, xmake should not add the mistake in the repo's list

Project Configuration

No response

Additional Information and Error Logs

I still can remove that bad one :

PS G:\Projects> xrepo rm-repo git@github.com:glcraft/xmake-custom-repo.git
remove global repository(git@github.com:glcraft/xmake-custom-repo.git): ok!

PS G:\Projects> xrepo list-repo
global repositories:
    custom-repo git@github.com:glcraft/xmake-custom-repo.git master
    build-artifacts https://github.com/xmake-mirror/build-artifacts.git main
    xmake-repo https://github.com/xmake-io/xmake-repo.git master
    builtin-repo C:\Users\glitc\xmake\repository

4 repositories were found!
@glcraft glcraft added the bug label Nov 21, 2022
@glcraft
Copy link
Contributor Author

glcraft commented Nov 21, 2022

This is not a serious problem for me, i just noticed it

@waruqi waruqi added this to the v2.7.4 milestone Nov 22, 2022
@waruqi
Copy link
Member

waruqi commented Nov 22, 2022

I have fixed it on dev. xmake update -s dev

waruqi added a commit that referenced this issue Nov 22, 2022
@waruqi waruqi closed this as completed Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants