summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2016-05-19 15:22:02 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2016-05-19 15:22:02 +0200
commit6ee08d2cd0671d42e4148988863a6a40fbe721cb (patch)
tree53ae4d3cc52a1bdab361237cdeb750e2ef0cdf49
parent922496562b82d79e9c4138b69299801274b7bf1c (diff)
downloadlibgit2-6ee08d2cd0671d42e4148988863a6a40fbe721cb.tar.gz
tree: use the basename for the entry removal
When we want to remove the file, use the basename as the name of the entry to remove, instead of the full one, which includes the directories we've inserted into the stack.
-rw-r--r--src/tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tree.c b/src/tree.c
index af293d264..c5a13eaa1 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -1230,7 +1230,7 @@ int git_tree_create_updated(git_oid *out, git_repository *repo, git_tree *baseli
break;
}
case GIT_TREE_UPDATE_REMOVE:
- error = git_treebuilder_remove(git_array_last(stack)->bld, update->path);
+ error = git_treebuilder_remove(git_array_last(stack)->bld, git_path_basename(update->path));
break;
default:
giterr_set(GITERR_TREE, "unkown action for update");