summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2010-07-17 17:00:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-07-19 18:12:15 (GMT)
commit4087a02e452aafd0e9a6c3471c40fe76d6aafbe4 (patch)
tree678629b4fe58e1c6a8ed175aabd75345fb54fe23 /t
parent0ad0a61f05fe521a63ade9bfafd2f589fba0df33 (diff)
downloadgit-4087a02e452aafd0e9a6c3471c40fe76d6aafbe4.zip
git-4087a02e452aafd0e9a6c3471c40fe76d6aafbe4.tar.gz
git-4087a02e452aafd0e9a6c3471c40fe76d6aafbe4.tar.bz2
fast-export: Fix dropping of files with --import-marks and path limiting
Since fast-export operates by listing file changes since the (first) parent commit, when using --import-marks and path limiting and using a wider list of paths than in previous runs, files from the new path(s) will silently be omitted from the result unless or until a commit which explicitly changes those files. The resulting repository in such cases is broken and makes no sense. This commit fixes this by having fast-export work with complete trees instead of incremental changes (when both --import-marks and path limiting are used). It works by issuing a 'deleteall' directive with each commit and then listing the full set of files that make up that commit, rather than just showing the list of files that have changed since the (first) parent commit. Signed-off-by: Elijah Newren <newren@gmail.com> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9350-fast-export.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index d43f37c..6069e1f 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -355,6 +355,15 @@ test_expect_failure 'no exact-ref revisions included' '
)
'
+test_expect_success 'path limiting with import-marks does not lose unmodified files' '
+ git checkout -b simple marks~2 &&
+ git fast-export --export-marks=marks simple -- file > /dev/null &&
+ echo more content >> file &&
+ test_tick &&
+ git commit -mnext file &&
+ git fast-export --import-marks=marks simple -- file file0 | grep file0
+'
+
test_expect_success 'set-up a few more tags for tag export tests' '
git checkout -f master &&
HEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed "s/tree //"` &&