Skip to content

Instantly share code, notes, and snippets.

@icecrime
Created December 6, 2014 03:49
Show Gist options
  • Save icecrime/8f6b4151d22f9ba932df to your computer and use it in GitHub Desktop.
Save icecrime/8f6b4151d22f9ba932df to your computer and use it in GitHub Desktop.
libpack fix for networking extensions
diff --git a/vendor/src/github.com/docker/libpack/tree.go b/vendor/src/github.com/docker/libpack/tree.go
index 89d8a18..3b236c1 100644
--- a/vendor/src/github.com/docker/libpack/tree.go
+++ b/vendor/src/github.com/docker/libpack/tree.go
@@ -16,6 +16,7 @@ func treeDel(repo *git.Repository, tree *git.Tree, key string) (*git.Tree, error
key = TreePath(key)
base, leaf := path.Split(key)
+ root := tree
if tree != nil {
if tree, err = TreeScope(repo, tree, base); err != nil {
return nil, err
@@ -36,12 +37,10 @@ func treeDel(repo *git.Repository, tree *git.Tree, key string) (*git.Tree, error
return nil, err
}
- newTree, err := lookupTree(repo, treeId)
- if err != nil {
- return nil, err
+ if base == "" {
+ return lookupTree(repo, treeId)
}
-
- return newTree, err
+ return treeAdd(repo, root, key, treeId, false)
}
// treeAdd creates a new Git tree by adding a new object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment