-
Notifications
You must be signed in to change notification settings - Fork 290
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
Don't delete refs having aliases #1749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor bits.
src/ostree/ot-builtin-refs.c
Outdated
ref_alias, const char *, value) | ||
{ | ||
if (!strcmp(ref, value)) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation looks off here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, fixed it!
Is there an automatic source formatter (config) which I can use during OSTree development?
src/ostree/ot-builtin-refs.c
Outdated
if (!strcmp(ref, value)) | ||
{ | ||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, | ||
"Ref %s has some aliases, first delete corresponding aliases", ref); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about: "Ref '%s' has an active alias: '%s'", ref, ref_alias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, updated the error message.
This PR has been updated with changes from feedback and ready for further review. |
src/ostree/ot-builtin-refs.c
Outdated
GLNX_HASH_TABLE_FOREACH_KV (ref_aliases, const char *, | ||
ref_alias, const char *, value) | ||
{ | ||
if (!strcmp(ref, value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing space between strcmp
and '('
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed it!
Deleting a ref with aliases makes them dangling. In such cases, display an error message to the user. Fixes ostreedev#1597 Signed-off-by: Sinny Kumari <sinny@redhat.com>
Nice work @sinnykumari ! |
💥 Test timed out |
@rh-atomic-bot retry |
☀️ Test successful - status-atomicjenkins |
Thanks @cgwalters ! |
This is the alias version of ostreedev#1749. I.e. we want to make sure that one can't even create an alias which would end up dangling. See also: https://pagure.io/releng/issue/7891
This is the alias version of #1749. I.e. we want to make sure that one can't even create an alias which would end up dangling. See also: https://pagure.io/releng/issue/7891 Closes: #1768 Approved by: sinnykumari
Deleting a ref with aliases makes them dangling. In such
cases, display an error message to the user.
Fixes #1597
Signed-off-by: Sinny Kumari sinny@redhat.com