diff options
author | Pierre Habouzit <madcoder@debian.org> | 2008-10-31 10:12:21 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-11 02:35:58 +0100 |
commit | d3240d935c4b844db71e4570eeedfac4cff73f78 (patch) | |
tree | c6ad63efa78ac0133564147be4958280c70b3bc8 /t | |
parent | Merge branch 'mh/maint-sendmail-cc-doc' (diff) | |
download | git-d3240d935c4b844db71e4570eeedfac4cff73f78.tar.xz git-d3240d935c4b844db71e4570eeedfac4cff73f78.zip |
filter-branch: add git_commit_non_empty_tree and --prune-empty.
git_commit_non_empty_tree is added to the functions that can be run from
commit filters. Its effect is to commit only commits actually touching the
tree and that are not merge points either.
The option --prune-empty is added. It defaults the commit-filter to
'git_commit_non_empty_tree "$@"', and can be used with any other
combination of filters, except --commit-hook that must used
'git_commit_non_empty_tree "$@"' where one puts 'git commit-tree "$@"'
usually to achieve the same result.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7003-filter-branch.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index b0a9d7d536..8537bf9160 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -262,4 +262,12 @@ test_expect_success 'Tag name filtering allows slashes in tag names' ' test_cmp expect actual ' +test_expect_success 'Prune empty commits' ' + git rev-list HEAD > expect && + make_commit to_remove && + git filter-branch -f --index-filter "git update-index --remove to_remove" --prune-empty HEAD && + git rev-list HEAD > actual && + test_cmp expect actual +' + test_done |