diff options
author | 2018-04-03 10:57:45 -0700 | |
---|---|---|
committer | 2018-04-05 17:05:48 +0900 | |
commit | 86238e07ef633f7488ac708578aaf71e4375c057 (patch) | |
tree | 9654c313bcfe887648594ac787b1e304b527a88e /builtin | |
parent | Git 2.14.3 (diff) | |
download | tgif-86238e07ef633f7488ac708578aaf71e4375c057.tar.xz |
commit: allow partial commits with relative paths
Commit 8894d53580 (commit: allow partial commits with relative paths,
2011-07-30) ensured that partial commits were allowed when a user
supplies a relative pathspec but then this was regressed in 5879f5684c
(remove prefix argument from pathspec_prefix, 2011-09-04) when the
prefix argument to 'pathspec_prefix' removed and the 'list_paths'
function wasn't properly adjusted to cope with the change, resulting in
over-eager pruning of the tree that is overlayed on the index.
This fixes the regression and adds a regression test so this can be
prevented in the future.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/commit.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 1a0da71a43..12a0995b36 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -253,8 +253,7 @@ static int list_paths(struct string_list *list, const char *with_tree, if (with_tree) { char *max_prefix = common_prefix(pattern); - overlay_tree_on_index(&the_index, with_tree, - max_prefix ? max_prefix : prefix); + overlay_tree_on_index(&the_index, with_tree, max_prefix); free(max_prefix); } |