summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-11 11:04:28 -0700
committerJunio C Hamano <gitster@pobox.com>2011-08-11 11:04:28 -0700
commit0af53e188a3a8915f65c3b3edaeed3e07d8d3802 (patch)
treebcce70ab66b456b001140964f5c89e5b5888a35c /builtin/commit.c
parentb81b758d5001c4ebab1a5b8202bb1b0f4cdf3391 (diff)
parent8894d5358095a08c2f700a87ce9fdefb0b6eb61b (diff)
downloadgit-0af53e188a3a8915f65c3b3edaeed3e07d8d3802.tar.gz
Merge branch 'cb/partial-commit-relative-pathspec'
* cb/partial-commit-relative-pathspec: commit: allow partial commits with relative paths
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index e1af9b19f0..cb738574f7 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -256,8 +256,10 @@ 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);
+ if (with_tree) {
+ const char *max_prefix = pathspec_prefix(prefix, pattern);
+ overlay_tree_on_cache(with_tree, max_prefix);
+ }
for (i = 0; i < active_nr; i++) {
struct cache_entry *ce = active_cache[i];