diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-01-27 19:23:53 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-01-27 19:23:53 +0100 |
commit | 5ce3258122939f93a927c75d308c1c34038f0386 (patch) | |
tree | f4a60897502baeb1be16c81b4dafc08aa5c5bdac /fast-import.c | |
parent | rebase: give a better error message for bogus branch (diff) | |
parent | fast-import: treat filemodify with empty tree as delete (diff) | |
download | git-5ce3258122939f93a927c75d308c1c34038f0386.tar.xz git-5ce3258122939f93a927c75d308c1c34038f0386.zip |
Merge branch 'jn/fast-import-empty-tree-removal' into maint
* jn/fast-import-empty-tree-removal:
fast-import: treat filemodify with empty tree as delete
Diffstat (limited to 'fast-import.c')
-rw-r--r-- | fast-import.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fast-import.c b/fast-import.c index 613623be14..7563e43a39 100644 --- a/fast-import.c +++ b/fast-import.c @@ -2166,6 +2166,12 @@ static void file_change_m(struct branch *b) p = uq.buf; } + /* Git does not track empty, non-toplevel directories. */ + if (S_ISDIR(mode) && !memcmp(sha1, EMPTY_TREE_SHA1_BIN, 20) && *p) { + tree_content_remove(&b->branch_tree, p, NULL); + return; + } + if (S_ISGITLINK(mode)) { if (inline_data) die("Git links cannot be specified 'inline': %s", |