From: Michael J Gruber Date: Mon, 25 Jul 2011 07:42:10 GMT Subject: [RFC/PATCH] commit: allow partial commits with relative paths Message-ID: <19b908142567fcfafe4da3d0fd60b134d30c613a.1311579663.git.git@drmicha.warpmail.net> In-Reply-To: In order to do partial commits, git-commit overlays a tree on the cache and checks pathspecs against the result. Currently, the overlaying is done using "prefix" which prevents relative pathspecs with ".." and absolute pathspec from matching when they refer to files not under "prefix" and absent from the index, but still in the tree (i.e. files staged for removal). Overlay the full tree instead. Reported-by: Reuben Thomas Signed-off-by: Michael J Gruber --- RFC because lack of test, and also because I'm not sure we want this, and what to do about git add which has the same problem, but would need a different fix. --- builtin/commit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index e1af9b1..431590c 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -257,7 +257,7 @@ static int list_paths(struct string_list *list, const char *with_tree, m = xcalloc(1, i); if (with_tree) - overlay_tree_on_cache(with_tree, prefix); + overlay_tree_on_cache(with_tree, NULL); for (i = 0; i < active_nr; i++) { struct cache_entry *ce = active_cache[i]; -- 1.7.6.336.gdf067