File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,5 @@ func (gf *GitRef) loadQuery(query url.Values) error {
176176 }
177177 gf .Ref = branch
178178 }
179- if gf .Checksum != "" && gf .Ref == "" {
180- gf .Ref = gf .Checksum
181- }
182179 return nil
183180}
Original file line number Diff line number Diff line change @@ -472,11 +472,26 @@ COPY foo out
472472 url : serverURL + "/.git?commit=" + commitHashV2 ,
473473 expectOut : "v0.0.2\n " ,
474474 },
475+ {
476+ name : "v2 by commit (wrong short)" ,
477+ url : serverURL + "/.git?commit=" + commitHashV2 [:8 ],
478+ expectErr : "expected checksum to match" ,
479+ },
480+ {
481+ name : "v2 by commit (short)" ,
482+ url : serverURL + "/.git?commit=" + commitHashLatest [:8 ],
483+ expectOut : "latest\n " ,
484+ },
475485 {
476486 name : "v2 ref by commit" ,
477487 url : serverURL + "/.git?ref=" + commitHashV2 ,
478488 expectOut : "v0.0.2\n " ,
479489 },
490+ {
491+ name : "v2 ref by commit (short)" ,
492+ url : serverURL + "/.git?ref=" + commitHashV2 [:8 ],
493+ expectErr : "repository does not contain ref" ,
494+ },
480495 {
481496 name : "tag with commit" ,
482497 url : serverURL + "/.git?tag=v0.0.2&commit=" + commitHashV2 ,
You can’t perform that action at this time.
0 commit comments