Commit b8bd89a3 authored by Kirill Smelkov's avatar Kirill Smelkov

obj_represent_as_commit is always called with obj_type non-empty

It was a default leftover to autodetect object type if obj_type=None,
from the beginning - from bbee44ce (Start of git-backup.git) - because
even there obj_represent_as_commit() is always called with obj_type
explicitly passed in.

So remove the leftover.
parent 28986e0e
...@@ -214,9 +214,6 @@ func xcommit_tree(tree Sha1, parents []Sha1, msg string) Sha1 { ...@@ -214,9 +214,6 @@ func xcommit_tree(tree Sha1, parents []Sha1, msg string) Sha1 {
// through created commit. // through created commit.
var tag_tree_blob = StrSet{"tag": {}, "tree": {}, "blob": {}} var tag_tree_blob = StrSet{"tag": {}, "tree": {}, "blob": {}}
func obj_represent_as_commit(sha1 Sha1, obj_type string) Sha1 { func obj_represent_as_commit(sha1 Sha1, obj_type string) Sha1 {
if obj_type == "" {
obj_type = xgit("cat-file", "-t", sha1)
}
if !tag_tree_blob.Contains(obj_type) { if !tag_tree_blob.Contains(obj_type) {
raisef("%s (%s): cannot encode as commit", sha1, obj_type) raisef("%s (%s): cannot encode as commit", sha1, obj_type)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment