Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ee08d2

Browse files
committed
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.
1 parent 9224965 commit 6ee08d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ int git_tree_create_updated(git_oid *out, git_repository *repo, git_tree *baseli
12301230
break;
12311231
}
12321232
case GIT_TREE_UPDATE_REMOVE:
1233-
error = git_treebuilder_remove(git_array_last(stack)->bld, update->path);
1233+
error = git_treebuilder_remove(git_array_last(stack)->bld, git_path_basename(update->path));
12341234
break;
12351235
default:
12361236
giterr_set(GITERR_TREE, "unkown action for update");

0 commit comments

Comments
 (0)