Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
image board
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
random asynchronous nightmare distributor
image board
Commits
d4954821
Commit
d4954821
authored
3 years ago
by
Ophestra
Browse files
Options
Downloads
Patches
Plain Diff
implement proper parent unsetting, reject setting parent when already grouped
parent
40f5a0d9
No related branches found
Branches containing commit
Tags
v1.4.2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
store/image.go
+21
-3
21 additions, 3 deletions
store/image.go
with
21 additions
and
3 deletions
store/image.go
+
21
−
3
View file @
d4954821
...
...
@@ -315,22 +315,40 @@ func (s *Store) ImageUpdate(hash, source, parent, commentary, commentaryTranslat
info
.
Source
=
source
msg
+=
"source"
}
if
parent
!=
"
\0
00"
&&
parent
!=
""
&&
parent
!=
info
.
Snowflake
{
if
parent
!=
"
\0
00"
&&
parent
!=
info
.
Snowflake
{
if
p
:=
s
.
ImageSnowflake
(
parent
);
p
.
Snowflake
==
parent
{
s
.
getLock
(
p
.
Hash
)
.
Lock
()
defer
s
.
getLock
(
p
.
Hash
)
.
Unlock
()
// If no parent, then get the current parent and unset
if
parent
==
""
{
p
=
s
.
ImageSnowflake
(
info
.
Parent
)
// If no current parent, nothing to do
if
p
.
Snowflake
==
""
{
goto
end
}
}
else
{
// If setting parent but parent has child, reject
if
p
.
Child
!=
""
{
goto
end
}
}
info
.
Parent
=
parent
// Update the parent to reflect the child
p
.
Child
=
info
.
Snowflake
if
parent
==
""
{
p
.
Child
=
""
}
s
.
getLock
(
p
.
Hash
)
.
Lock
()
s
.
imageMetadataWrite
(
p
)
s
.
getLock
(
p
.
Hash
)
.
Unlock
()
if
msg
!=
""
{
msg
+=
", "
}
msg
+=
"parent "
+
parent
}
end
:
}
if
commentary
!=
"
\0
00"
{
info
.
Commentary
=
commentary
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment