Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
git-mirror
/
git
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security
Insights
Files
334fba6
Documentation
block-sha1
builtin
compat
contrib
git-gui
git_remote_helpers
gitk-git
gitweb
perl
ppc
t
lib-httpd
t1509
t3900
t4013
t4020
t4100
t4101
t4109
t4110
t4252
t5100
t5515
t7004
t7006
t7500
t8005
t9110
t9111
t9115
t9121
t9126
t9135
t9136
t9150
t9151
t9153
t9154
t9601
t9602
t9603
t9700
valgrind
.gitattributes
.gitignore
Makefile
README
aggregate-results.sh
annotate-tests.sh
diff-lib.sh
gitweb-lib.sh
lib-cvs.sh
lib-git-svn.sh
lib-httpd.sh
lib-pager.sh
lib-patch-mode.sh
lib-read-tree-m-3way.sh
lib-rebase.sh
lib-t6000.sh
t0000-basic.sh
t0001-init.sh
t0002-gitfile.sh
t0003-attributes.sh
t0004-unwritable.sh
t0005-signals.sh
t0006-date.sh
t0010-racy-git.sh
t0020-crlf.sh
t0021-conversion.sh
t0022-crlf-rename.sh
t0023-crlf-am.sh
t0024-crlf-archive.sh
t0025-crlf-auto.sh
t0026-eol-config.sh
t0030-stripspace.sh
t0040-parse-options.sh
t0050-filesystem.sh
t0055-beyond-symlinks.sh
t0060-path-utils.sh
t0061-run-command.sh
t0070-fundamental.sh
t0100-previous.sh
t0101-at-syntax.sh
t1000-read-tree-m-3way.sh
t1001-read-tree-m-2way.sh
t1002-read-tree-m-u-2way.sh
t1003-read-tree-prefix.sh
t1004-read-tree-m-u-wf.sh
t1005-read-tree-reset.sh
t1006-cat-file.sh
t1007-hash-object.sh
t1008-read-tree-overlay.sh
t1009-read-tree-new-index.sh
t1010-mktree.sh
t1011-read-tree-sparse-checkout.sh
t1012-read-tree-df.sh
t1020-subdirectory.sh
t1100-commit-tree-options.sh
t1200-tutorial.sh
t1300-repo-config.sh
t1301-shared-repo.sh
t1302-repo-version.sh
t1303-wacky-config.sh
t1304-default-acl.sh
t1400-update-ref.sh
t1401-symbolic-ref.sh
t1402-check-ref-format.sh
t1410-reflog.sh
t1411-reflog-show.sh
t1420-lost-found.sh
t1450-fsck.sh
t1500-rev-parse.sh
t1501-worktree.sh
t1502-rev-parse-parseopt.sh
t1503-rev-parse-verify.sh
t1504-ceiling-dirs.sh
t1505-rev-parse-last.sh
t1506-rev-parse-diagnosis.sh
t1507-rev-parse-upstream.sh
t1508-at-combinations.sh
t1509-root-worktree.sh
t2000-checkout-cache-clash.sh
t2001-checkout-cache-clash.sh
t2002-checkout-cache-u.sh
t2003-checkout-cache-mkdir.sh
t2004-checkout-cache-temp.sh
t2005-checkout-index-symlinks.sh
t2007-checkout-symlink.sh
t2008-checkout-subdir.sh
t2009-checkout-statinfo.sh
t2010-checkout-ambiguous.sh
t2011-checkout-invalid-head.sh
t2012-checkout-last.sh
t2013-checkout-submodule.sh
t2014-switch.sh
t2015-checkout-unborn.sh
t2016-checkout-patch.sh
t2017-checkout-orphan.sh
t2030-unresolve-info.sh
t2050-git-dir-relative.sh
t2100-update-cache-badpath.sh
t2101-update-index-reupdate.sh
t2102-update-index-symlinks.sh
t2103-update-index-ignore-missing.sh
t2104-update-index-skip-worktree.sh
t2105-update-index-gitfile.sh
t2106-update-index-assume-unchanged.sh
t2200-add-update.sh
t2201-add-update-typechange.sh
t2202-add-addremove.sh
t2203-add-intent.sh
t2204-add-ignored.sh
t2300-cd-to-toplevel.sh
t3000-ls-files-others.sh
t3001-ls-files-others-exclude.sh
t3002-ls-files-dashpath.sh
t3003-ls-files-exclude.sh
t3010-ls-files-killed-modified.sh
t3020-ls-files-error-unmatch.sh
t3030-merge-recursive.sh
t3031-merge-criscross.sh
t3040-subprojects-basic.sh
t3050-subprojects-fetch.sh
t3060-ls-files-with-tree.sh
t3100-ls-tree-restrict.sh
t3101-ls-tree-dirname.sh
t3200-branch.sh
t3201-branch-contains.sh
t3202-show-branch-octopus.sh
t3203-branch-output.sh
t3210-pack-refs.sh
t3300-funny-names.sh
t3301-notes.sh
t3302-notes-index-expensive.sh
t3303-notes-subtrees.sh
t3304-notes-mixed.sh
t3305-notes-fanout.sh
t3306-notes-prune.sh
t3307-notes-man.sh
t3400-rebase.sh
t3401-rebase-partial.sh
t3402-rebase-merge.sh
t3403-rebase-skip.sh
t3404-rebase-interactive.sh
t3405-rebase-malformed.sh
t3406-rebase-message.sh
t3407-rebase-abort.sh
t3408-rebase-multi-line.sh
t3409-rebase-preserve-merges.sh
t3410-rebase-preserve-dropped-merges.sh
t3411-rebase-preserve-around-merges.sh
t3412-rebase-root.sh
t3413-rebase-hook.sh
t3414-rebase-preserve-onto.sh
t3415-rebase-autosquash.sh
t3416-rebase-onto-threedots.sh
t3417-rebase-whitespace-fix.sh
t3500-cherry.sh
t3501-revert-cherry-pick.sh
t3502-cherry-pick-merge.sh
t3503-cherry-pick-root.sh
t3504-cherry-pick-rerere.sh
t3505-cherry-pick-empty.sh
t3506-cherry-pick-ff.sh
t3507-cherry-pick-conflict.sh
t3508-cherry-pick-many-commits.sh
t3600-rm.sh
t3700-add.sh
t3701-add-interactive.sh
t3702-add-edit.sh
t3800-mktag.sh
t3900-i18n-commit.sh
t3901-8859-1.txt
t3901-i18n-patch.sh
t3901-utf8.txt
t3902-quoted.sh
t3903-stash.sh
t3904-stash-patch.sh
t4000-diff-format.sh
t4001-diff-rename.sh
t4002-diff-basic.sh
t4003-diff-rename-1.sh
t4004-diff-rename-symlink.sh
t4005-diff-rename-2.sh
t4006-diff-mode.sh
t4007-rename-3.sh
t4008-diff-break-rewrite.sh
t4009-diff-rename-4.sh
t4010-diff-pathspec.sh
t4011-diff-symlink.sh
t4012-diff-binary.sh
t4013-diff-various.sh
t4014-format-patch.sh
t4015-diff-whitespace.sh
t4016-diff-quote.sh
t4017-diff-retval.sh
t4018-diff-funcname.sh
t4019-diff-wserror.sh
t4020-diff-external.sh
t4021-format-patch-numbered.sh
t4022-diff-rewrite.sh
t4023-diff-rename-typechange.sh
t4024-diff-optimize-common.sh
t4025-hunk-header.sh
t4026-color.sh
t4027-diff-submodule.sh
t4028-format-patch-mime-headers.sh
t4029-diff-trailing-space.sh
t4030-diff-textconv.sh
t4031-diff-rewrite-binary.sh
t4032-diff-inter-hunk-context.sh
t4033-diff-patience.sh
t4034-diff-words.sh
t4035-diff-quiet.sh
t4036-format-patch-signer-mime.sh
t4037-diff-r-t-dirs.sh
t4038-diff-combined.sh
t4039-diff-assume-unchanged.sh
t4040-whitespace-status.sh
t4041-diff-submodule-option.sh
t4042-diff-textconv-caching.sh
t4043-diff-rename-binary.sh
t4044-diff-index-unique-abbrev.sh
t4100-apply-stat.sh
t4101-apply-nonl.sh
t4102-apply-rename.sh
t4103-apply-binary.sh
t4104-apply-boundary.sh
t4105-apply-fuzz.sh
t4106-apply-stdin.sh
t4107-apply-ignore-whitespace.sh
t4109-apply-multifrag.sh
t4110-apply-scan.sh
t4112-apply-renames.sh
t4113-apply-ending.sh
t4114-apply-typechange.sh
t4115-apply-symlink.sh
t4116-apply-reverse.sh
t4117-apply-reject.sh
t4118-apply-empty-context.sh
t4119-apply-config.sh
t4120-apply-popt.sh
t4121-apply-diffs.sh
t4122-apply-symlink-inside.sh
t4123-apply-shrink.sh
t4124-apply-ws-rule.sh
t4125-apply-ws-fuzz.sh
t4126-apply-empty.sh
t4127-apply-same-fn.sh
t4128-apply-root.sh
t4129-apply-samemode.sh
t4130-apply-criss-cross-rename.sh
t4131-apply-fake-ancestor.sh
t4132-apply-removal.sh
t4133-apply-filenames.sh
t4134-apply-submodule.sh
t4150-am.sh
t4151-am-abort.sh
t4200-rerere.sh
t4201-shortlog.sh
t4202-log.sh
t4203-mailmap.sh
t4204-patch-id.sh
t4205-log-pretty-formats.sh
t4206-log-follow-harder-copies.sh
t4207-log-decoration-colors.sh
t4252-am-options.sh
t4253-am-keep-cr-dos.sh
t5000-tar-tree.sh
t5001-archive-attr.sh
t5100-mailinfo.sh
t5150-request-pull.sh
t5300-pack-object.sh
t5301-sliding-window.sh
t5302-pack-index.sh
t5303-pack-corruption-resilience.sh
t5304-prune.sh
t5305-include-tag.sh
t5306-pack-nobase.sh
t5307-pack-missing-commit.sh
t5400-send-pack.sh
t5401-update-hooks.sh
t5402-post-merge-hook.sh
t5403-post-checkout-hook.sh
t5404-tracking-branches.sh
t5405-send-pack-rewind.sh
t5406-remote-rejects.sh
t5407-post-rewrite-hook.sh
t5500-fetch-pack.sh
t5502-quickfetch.sh
t5503-tagfollow.sh
t5505-remote.sh
t5506-remote-groups.sh
t5510-fetch.sh
t5511-refspec.sh
t5512-ls-remote.sh
t5513-fetch-track.sh
t5514-fetch-multiple.sh
t5515-fetch-merge-logic.sh
t5516-fetch-push.sh
t5517-push-mirror.sh
t5518-fetch-exit-status.sh
t5519-push-alternates.sh
t5520-pull.sh
t5521-pull-options.sh
t5522-pull-symlink.sh
t5523-push-upstream.sh
t5524-pull-msg.sh
t5530-upload-pack-error.sh
t5531-deep-submodule-push.sh
t5540-http-push.sh
t5541-http-push.sh
t5550-http-fetch.sh
t5551-http-fetch.sh
t5560-http-backend-noserver.sh
t5561-http-backend.sh
t556x_common
t5600-clone-fail-cleanup.sh
t5601-clone.sh
t5602-clone-remote-exec.sh
t5700-clone-reference.sh
t5701-clone-local.sh
t5702-clone-options.sh
t5704-bundle.sh
t5705-clone-2gb.sh
t5706-clone-branch.sh
t5710-info-alternate.sh
t5800-remote-helpers.sh
t6001-rev-list-graft.sh
t6002-rev-list-bisect.sh
t6003-rev-list-topo-order.sh
t6004-rev-list-path-optim.sh
t6005-rev-list-count.sh
t6006-rev-list-format.sh
t6007-rev-list-cherry-pick-file.sh
t6008-rev-list-submodule.sh
t6009-rev-list-parent.sh
t6010-merge-base.sh
t6011-rev-list-with-bad-commit.sh
t6012-rev-list-simplify.sh
t6013-rev-list-reverse-parents.sh
t6014-rev-list-all.sh
t6015-rev-list-show-all-parents.sh
t6016-rev-list-graph-simplify-history.sh
t6017-rev-list-stdin.sh
t6018-rev-list-glob.sh
t6019-rev-list-ancestry-path.sh
t6020-merge-df.sh
t6021-merge-criss-cross.sh
t6022-merge-rename.sh
t6023-merge-file.sh
t6024-recursive-merge.sh
t6025-merge-symlinks.sh
t6026-merge-attr.sh
t6027-merge-binary.sh
t6028-merge-up-to-date.sh
t6029-merge-subtree.sh
t6030-bisect-porcelain.sh
t6031-merge-recursive.sh
t6032-merge-large-rename.sh
t6033-merge-crlf.sh
t6034-merge-rename-nocruft.sh
t6035-merge-dir-to-symlink.sh
t6036-recursive-corner-cases.sh
t6037-merge-ours-theirs.sh
t6040-tracking-info.sh
t6050-replace.sh
t6101-rev-parse-parents.sh
t6120-describe.sh
t6200-fmt-merge-msg.sh
t6300-for-each-ref.sh
t7001-mv.sh
t7003-filter-branch.sh
t7004-tag.sh
t7005-editor.sh
t7006-pager.sh
t7007-show.sh
t7008-grep-binary.sh
t7010-setup.sh
t7011-skip-worktree-reading.sh
t7012-skip-worktree-writing.sh
t7060-wtstatus.sh
t7101-reset.sh
t7102-reset.sh
t7103-reset-bare.sh
t7104-reset.sh
t7105-reset-patch.sh
t7110-reset-merge.sh
t7111-reset-table.sh
t7201-co.sh
t7300-clean.sh
t7400-submodule-basic.sh
t7401-submodule-summary.sh
t7402-submodule-rebase.sh
t7403-submodule-sync.sh
t7405-submodule-merge.sh
t7406-submodule-update.sh
t7407-submodule-foreach.sh
t7408-submodule-reference.sh
t7500-commit.sh
t7501-commit.sh
t7502-commit.sh
t7503-pre-commit-hook.sh
t7504-commit-msg-hook.sh
t7505-prepare-commit-msg-hook.sh
t7506-status-submodule.sh
t7507-commit-verbose.sh
t7508-status.sh
t7509-commit.sh
t7600-merge.sh
t7601-merge-pull-config.sh
t7602-merge-octopus-many.sh
t7603-merge-reduce-heads.sh
t7604-merge-custom-message.sh
t7605-merge-resolve.sh
t7606-merge-custom.sh
t7607-merge-overwrite.sh
t7608-merge-messages.sh
t7610-mergetool.sh
t7700-repack.sh
t7701-repack-unpack-unreachable.sh
t7800-difftool.sh
t7810-grep.sh
t7811-grep-open.sh
t8001-annotate.sh
t8002-blame.sh
t8003-blame.sh
t8004-blame.sh
t8005-blame-i18n.sh
t8006-blame-textconv.sh
t8007-cat-file-textconv.sh
t9001-send-email.sh
t9100-git-svn-basic.sh
t9101-git-svn-props.sh
t9102-git-svn-deep-rmdir.sh
t9103-git-svn-tracked-directory-removed.sh
t9104-git-svn-follow-parent.sh
t9105-git-svn-commit-diff.sh
t9106-git-svn-commit-diff-clobber.sh
t9107-git-svn-migrate.sh
t9108-git-svn-glob.sh
t9109-git-svn-multi-glob.sh
t9110-git-svn-use-svm-props.sh
t9111-git-svn-use-svnsync-props.sh
t9112-git-svn-md5less-file.sh
t9113-git-svn-dcommit-new-file.sh
t9114-git-svn-dcommit-merge.sh
t9115-git-svn-dcommit-funky-renames.sh
t9116-git-svn-log.sh
t9117-git-svn-init-clone.sh
t9118-git-svn-funky-branch-names.sh
t9119-git-svn-info.sh
t9120-git-svn-clone-with-percent-escapes.sh
t9121-git-svn-fetch-renamed-dir.sh
t9122-git-svn-author.sh
t9123-git-svn-rebuild-with-rewriteroot.sh
t9124-git-svn-dcommit-auto-props.sh
t9125-git-svn-multi-glob-branch-names.sh
t9126-git-svn-follow-deleted-readded-directory.sh
t9127-git-svn-partial-rebuild.sh
t9128-git-svn-cmd-branch.sh
t9129-git-svn-i18n-commitencoding.sh
t9130-git-svn-authors-file.sh
t9131-git-svn-empty-symlink.sh
t9132-git-svn-broken-symlink.sh
t9133-git-svn-nested-git-repo.sh
t9134-git-svn-ignore-paths.sh
t9135-git-svn-moved-branch-empty-file.sh
t9136-git-svn-recreated-branch-empty-file.sh
t9137-git-svn-dcommit-clobber-series.sh
t9138-git-svn-authors-prog.sh
t9139-git-svn-non-utf8-commitencoding.sh
t9140-git-svn-reset.sh
t9141-git-svn-multiple-branches.sh
t9142-git-svn-shallow-clone.sh
t9143-git-svn-gc.sh
t9144-git-svn-old-rev_map.sh
t9145-git-svn-master-branch.sh
t9146-git-svn-empty-dirs.sh
t9150-svk-mergetickets.sh
t9151-svn-mergeinfo.sh
t9152-svn-empty-dirs-after-gc.sh
t9153-git-svn-rewrite-uuid.sh
t9154-git-svn-fancy-glob.sh
t9200-git-cvsexportcommit.sh
t9300-fast-import.sh
t9301-fast-import-notes.sh
t9350-fast-export.sh
t9400-git-cvsserver-server.sh
t9401-git-cvsserver-crlf.sh
t9500-gitweb-standalone-no-errors.sh
t9501-gitweb-standalone-http-status.sh
t9502-gitweb-standalone-parse-output.sh
t9600-cvsimport.sh
t9601-cvsimport-vendor-branch.sh
t9602-cvsimport-branches-tags.sh
t9603-cvsimport-patchsets.sh
t9700-perl-git.sh
test-lib.sh
test4012.png
test9200a.png
test9200b.png
templates
xdiff
.gitattributes
.gitignore
.mailmap
COPYING
GIT-VERSION-GEN
INSTALL
Makefile
README
RelNotes
abspath.c
aclocal.m4
advice.c
advice.h
alias.c
alloc.c
archive-tar.c
archive-zip.c
archive.c
archive.h
attr.c
attr.h
base85.c
bisect.c
bisect.h
blob.c
blob.h
branch.c
branch.h
builtin.h
bundle.c
bundle.h
cache-tree.c
cache-tree.h
cache.h
check-builtins.sh
check-racy.c
check_bindir
color.c
color.h
combine-diff.c
command-list.txt
commit.c
commit.h
config.c
config.mak.in
configure.ac
connect.c
convert.c
copy.c
csum-file.c
csum-file.h
ctype.c
daemon.c
date.c
decorate.c
decorate.h
delta.h
diff-delta.c
diff-lib.c
diff-no-index.c
diff.c
diff.h
diffcore-break.c
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c
diffcore.h
dir.c
dir.h
editor.c
entry.c
environment.c
exec_cmd.c
exec_cmd.h
fast-import.c
fetch-pack.h
fixup-builtins
fsck.c
fsck.h
generate-cmdlist.sh
git-add--interactive.perl
git-am.sh
git-archimport.perl
git-bisect.sh
git-compat-util.h
git-cvsexportcommit.perl
git-cvsimport.perl
git-cvsserver.perl
git-difftool--helper.sh
git-difftool.perl
git-filter-branch.sh
git-instaweb.sh
git-lost-found.sh
git-merge-octopus.sh
git-merge-one-file.sh
git-merge-resolve.sh
git-mergetool--lib.sh
git-mergetool.sh
git-parse-remote.sh
git-pull.sh
git-quiltimport.sh
git-rebase--interactive.sh
git-rebase.sh
git-relink.perl
git-remote-testgit.py
git-repack.sh
git-request-pull.sh
git-send-email.perl
git-sh-setup.sh
git-stash.sh
git-submodule.sh
git-svn.perl
git-web--browse.sh
git.c
git.spec.in
graph.c
graph.h
grep.c
grep.h
hash.c
hash.h
help.c
help.h
hex.c
http-backend.c
http-fetch.c
http-push.c
http-walker.c
http.c
http.h
ident.c
imap-send.c
levenshtein.c
levenshtein.h
list-objects.c
list-objects.h
ll-merge.c
ll-merge.h
lockfile.c
log-tree.c
log-tree.h
mailmap.c
mailmap.h
match-trees.c
merge-file.c
merge-recursive.c
merge-recursive.h
name-hash.c
notes-cache.c
notes-cache.h
notes.c
notes.h
object.c
object.h
pack-check.c
pack-refs.c
pack-refs.h
pack-revindex.c
pack-revindex.h
pack-write.c
pack.h
pager.c
parse-options.c
parse-options.h
patch-delta.c
patch-ids.c
patch-ids.h
path.c
pkt-line.c
pkt-line.h
preload-index.c
pretty.c
progress.c
progress.h
quote.c
quote.h
reachable.c
reachable.h
read-cache.c
reflog-walk.c
reflog-walk.h
refs.c
refs.h
remote-curl.c
remote.c
remote.h
replace_object.c
rerere.c
rerere.h
resolve-undo.c
resolve-undo.h
revision.c
revision.h
run-command.c
run-command.h
send-pack.h
server-info.c
setup.c
sha1-lookup.c
sha1-lookup.h
sha1_file.c
sha1_name.c
shallow.c
shell.c
shortlog.h
show-index.c
sideband.c
sideband.h
sigchain.c
sigchain.h
strbuf.c
strbuf.h
string-list.c
string-list.h
submodule.c
submodule.h
symlinks.c
tag.c
tag.h
tar.h
test-chmtime.c
test-ctype.c
test-date.c
test-delta.c
test-dump-cache-tree.c
test-genrandom.c
test-index-version.c
test-match-trees.c
test-parse-options.c
test-path-utils.c
test-run-command.c
test-sha1.c
test-sha1.sh
test-sigchain.c
thread-utils.c
thread-utils.h
trace.c
transport-helper.c
transport.c
transport.h
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
tree.h
unimplemented.sh
unpack-trees.c
unpack-trees.h
upload-pack.c
url.c
url.h
usage.c
userdiff.c
userdiff.h
utf8.c
utf8.h
walker.c
walker.h
wrap-for-bin.sh
wrapper.c
write_or_die.c
ws.c
wt-status.c
wt-status.h
xdiff-interface.c
xdiff-interface.h
Breadcrumbs
git
/
t
/
t9300-fast-import.sh
Blame
Blame
Latest commit
History
History
executable file
·
1639 lines (1376 loc) · 36.4 KB
Breadcrumbs
git
/
t
/
t9300-fast-import.sh
Top
File metadata and controls
Code
Blame
executable file
·
1639 lines (1376 loc) · 36.4 KB
Raw
#!/bin/sh # # Copyright (c) 2007 Shawn Pearce # test_description='test git fast-import utility' . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash file2_data='file2 second line of EOF' file3_data='EOF in 3rd file END' file4_data=abcd file4_len=4 file5_data='an inline file. we should see it later.' file6_data='#!/bin/sh echo "$@"' ### ### series A ### test_tick cat >input <<INPUT_END blob mark :2 data <<EOF $file2_data EOF blob mark :3 data <<END $file3_data END blob mark :4 data $file4_len $file4_data commit refs/heads/master mark :5 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT initial COMMIT M 644 :2 file2 M 644 :3 file3 M 755 :4 file4 tag series-A from :5 data <<EOF An annotated tag without a tagger EOF INPUT_END test_expect_success \ 'A: create pack from stdin' \ 'git fast-import --export-marks=marks.out <input && git whatchanged master' test_expect_success \ 'A: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' cat >expect <<EOF author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE initial EOF test_expect_success \ 'A: verify commit' \ 'git cat-file commit master | sed 1d >actual && test_cmp expect actual' cat >expect <<EOF 100644 blob file2 100644 blob file3 100755 blob file4 EOF test_expect_success \ 'A: verify tree' \ 'git cat-file -p master^{tree} | sed "s/ [0-9a-f]* / /" >actual && test_cmp expect actual' echo "$file2_data" >expect test_expect_success \ 'A: verify file2' \ 'git cat-file blob master:file2 >actual && test_cmp expect actual' echo "$file3_data" >expect test_expect_success \ 'A: verify file3' \ 'git cat-file blob master:file3 >actual && test_cmp expect actual' printf "$file4_data" >expect test_expect_success \ 'A: verify file4' \ 'git cat-file blob master:file4 >actual && test_cmp expect actual' cat >expect <<EOF object $(git rev-parse refs/heads/master) type commit tag series-A An annotated tag without a tagger EOF test_expect_success 'A: verify tag/series-A' ' git cat-file tag tags/series-A >actual && test_cmp expect actual ' cat >expect <<EOF :2 `git rev-parse --verify master:file2` :3 `git rev-parse --verify master:file3` :4 `git rev-parse --verify master:file4` :5 `git rev-parse --verify master^0` EOF test_expect_success \ 'A: verify marks output' \ 'test_cmp expect marks.out' test_expect_success \ 'A: verify marks import' \ 'git fast-import \ --import-marks=marks.out \ --export-marks=marks.new \ </dev/null && test_cmp expect marks.new' test_tick cat >input <<INPUT_END commit refs/heads/verify--import-marks committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT recreate from :5 COMMIT from :5 M 755 :2 copy-of-file2 INPUT_END test_expect_success \ 'A: verify marks import does not crash' \ 'git fast-import --import-marks=marks.out <input && git whatchanged verify--import-marks' test_expect_success \ 'A: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' cat >expect <<EOF :000000 100755 0000000000000000000000000000000000000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 A copy-of-file2 EOF git diff-tree -M -r master verify--import-marks >actual test_expect_success \ 'A: verify diff' \ 'compare_diff_raw expect actual && test `git rev-parse --verify master:file2` \ = `git rev-parse --verify verify--import-marks:copy-of-file2`' ### ### series B ### test_tick cat >input <<INPUT_END commit refs/heads/branch mark :1 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT corrupt COMMIT from refs/heads/master M 755 0000000000000000000000000000000000000001 zero1 INPUT_END test_expect_success 'B: fail on invalid blob sha1' ' test_must_fail git fast-import <input ' rm -f .git/objects/pack_* .git/objects/index_* cat >input <<INPUT_END commit .badbranchname committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT corrupt COMMIT from refs/heads/master INPUT_END test_expect_success 'B: fail on invalid branch name ".badbranchname"' ' test_must_fail git fast-import <input ' rm -f .git/objects/pack_* .git/objects/index_* cat >input <<INPUT_END commit bad[branch]name committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT corrupt COMMIT from refs/heads/master INPUT_END test_expect_success 'B: fail on invalid branch name "bad[branch]name"' ' test_must_fail git fast-import <input ' rm -f .git/objects/pack_* .git/objects/index_* cat >input <<INPUT_END commit TEMP_TAG committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT tag base COMMIT from refs/heads/master INPUT_END test_expect_success \ 'B: accept branch name "TEMP_TAG"' \ 'git fast-import <input && test -f .git/TEMP_TAG && test `git rev-parse master` = `git rev-parse TEMP_TAG^`' rm -f .git/TEMP_TAG ### ### series C ### newf=`echo hi newf | git hash-object -w --stdin` oldf=`git rev-parse --verify master:file2` test_tick cat >input <<INPUT_END commit refs/heads/branch committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT second COMMIT from refs/heads/master M 644 $oldf file2/oldf M 755 $newf file2/newf D file3 INPUT_END test_expect_success \ 'C: incremental import create pack from stdin' \ 'git fast-import <input && git whatchanged branch' test_expect_success \ 'C: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' test_expect_success \ 'C: validate reuse existing blob' \ 'test $newf = `git rev-parse --verify branch:file2/newf` test $oldf = `git rev-parse --verify branch:file2/oldf`' cat >expect <<EOF parent `git rev-parse --verify master^0` author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE second EOF test_expect_success \ 'C: verify commit' \ 'git cat-file commit branch | sed 1d >actual && test_cmp expect actual' cat >expect <<EOF :000000 100755 0000000000000000000000000000000000000000 f1fb5da718392694d0076d677d6d0e364c79b0bc A file2/newf :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100 file2 file2/oldf :100644 000000 0d92e9f3374ae2947c23aa477cbc68ce598135f1 0000000000000000000000000000000000000000 D file3 EOF git diff-tree -M -r master branch >actual test_expect_success \ 'C: validate rename result' \ 'compare_diff_raw expect actual' ### ### series D ### test_tick cat >input <<INPUT_END commit refs/heads/branch committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT third COMMIT from refs/heads/branch^0 M 644 inline newdir/interesting data <<EOF $file5_data EOF M 755 inline newdir/exec.sh data <<EOF $file6_data EOF INPUT_END test_expect_success \ 'D: inline data in commit' \ 'git fast-import <input && git whatchanged branch' test_expect_success \ 'D: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' cat >expect <<EOF :000000 100755 0000000000000000000000000000000000000000 35a59026a33beac1569b1c7f66f3090ce9c09afc A newdir/exec.sh :000000 100644 0000000000000000000000000000000000000000 046d0371e9220107917db0d0e030628de8a1de9b A newdir/interesting EOF git diff-tree -M -r branch^ branch >actual test_expect_success \ 'D: validate new files added' \ 'compare_diff_raw expect actual' echo "$file5_data" >expect test_expect_success \ 'D: verify file5' \ 'git cat-file blob branch:newdir/interesting >actual && test_cmp expect actual' echo "$file6_data" >expect test_expect_success \ 'D: verify file6' \ 'git cat-file blob branch:newdir/exec.sh >actual && test_cmp expect actual' ### ### series E ### cat >input <<INPUT_END commit refs/heads/branch author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> Tue Feb 6 11:22:18 2007 -0500 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> Tue Feb 6 12:35:02 2007 -0500 data <<COMMIT RFC 2822 type date COMMIT from refs/heads/branch^0 INPUT_END test_expect_success 'E: rfc2822 date, --date-format=raw' ' test_must_fail git fast-import --date-format=raw <input ' test_expect_success \ 'E: rfc2822 date, --date-format=rfc2822' \ 'git fast-import --date-format=rfc2822 <input' test_expect_success \ 'E: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' cat >expect <<EOF author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 1170778938 -0500 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1170783302 -0500 RFC 2822 type date EOF test_expect_success \ 'E: verify commit' \ 'git cat-file commit branch | sed 1,2d >actual && test_cmp expect actual' ### ### series F ### old_branch=`git rev-parse --verify branch^0` test_tick cat >input <<INPUT_END commit refs/heads/branch committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT losing things already? COMMIT from refs/heads/branch~1 reset refs/heads/other from refs/heads/branch INPUT_END test_expect_success \ 'F: non-fast-forward update skips' \ 'if git fast-import <input then echo BAD gfi did not fail return 1 else if test $old_branch = `git rev-parse --verify branch^0` then : branch unaffected and failure returned return 0 else echo BAD gfi changed branch $old_branch return 1 fi fi ' test_expect_success \ 'F: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' cat >expect <<EOF tree `git rev-parse branch~1^{tree}` parent `git rev-parse branch~1` author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE losing things already? EOF test_expect_success \ 'F: verify other commit' \ 'git cat-file commit other >actual && test_cmp expect actual' ### ### series G ### old_branch=`git rev-parse --verify branch^0` test_tick cat >input <<INPUT_END commit refs/heads/branch committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT losing things already? COMMIT from refs/heads/branch~1 INPUT_END test_expect_success \ 'G: non-fast-forward update forced' \ 'git fast-import --force <input' test_expect_success \ 'G: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' test_expect_success \ 'G: branch changed, but logged' \ 'test $old_branch != `git rev-parse --verify branch^0` && test $old_branch = `git rev-parse --verify branch@{1}`' ### ### series H ### test_tick cat >input <<INPUT_END commit refs/heads/H committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT third COMMIT from refs/heads/branch^0 M 644 inline i-will-die data <<EOF this file will never exist. EOF deleteall M 644 inline h/e/l/lo data <<EOF $file5_data EOF INPUT_END test_expect_success \ 'H: deletall, add 1' \ 'git fast-import <input && git whatchanged H' test_expect_success \ 'H: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' cat >expect <<EOF :100755 000000 f1fb5da718392694d0076d677d6d0e364c79b0bc 0000000000000000000000000000000000000000 D file2/newf :100644 000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 0000000000000000000000000000000000000000 D file2/oldf :100755 000000 85df50785d62d3b05ab03d9cbf7e4a0b49449730 0000000000000000000000000000000000000000 D file4 :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100 newdir/interesting h/e/l/lo :100755 000000 e74b7d465e52746be2b4bae983670711e6e66657 0000000000000000000000000000000000000000 D newdir/exec.sh EOF git diff-tree -M -r H^ H >actual test_expect_success \ 'H: validate old files removed, new files added' \ 'compare_diff_raw expect actual' echo "$file5_data" >expect test_expect_success \ 'H: verify file' \ 'git cat-file blob H:h/e/l/lo >actual && test_cmp expect actual' ### ### series I ### cat >input <<INPUT_END commit refs/heads/export-boundary committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT we have a border. its only 40 characters wide. COMMIT from refs/heads/branch INPUT_END test_expect_success \ 'I: export-pack-edges' \ 'git fast-import --export-pack-edges=edges.list <input' cat >expect <<EOF .git/objects/pack/pack-.pack: `git rev-parse --verify export-boundary` EOF test_expect_success \ 'I: verify edge list' \ 'sed -e s/pack-.*pack/pack-.pack/ edges.list >actual && test_cmp expect actual' ### ### series J ### cat >input <<INPUT_END commit refs/heads/J committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT create J COMMIT from refs/heads/branch reset refs/heads/J commit refs/heads/J committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT initialize J COMMIT INPUT_END test_expect_success \ 'J: reset existing branch creates empty commit' \ 'git fast-import <input' test_expect_success \ 'J: branch has 1 commit, empty tree' \ 'test 1 = `git rev-list J | wc -l` && test 0 = `git ls-tree J | wc -l`' ### ### series K ### cat >input <<INPUT_END commit refs/heads/K committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT create K COMMIT from refs/heads/branch commit refs/heads/K committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT redo K COMMIT from refs/heads/branch^1 INPUT_END test_expect_success \ 'K: reinit branch with from' \ 'git fast-import <input' test_expect_success \ 'K: verify K^1 = branch^1' \ 'test `git rev-parse --verify branch^1` \ = `git rev-parse --verify K^1`' ### ### series L ### cat >input <<INPUT_END blob mark :1 data <<EOF some data EOF blob mark :2 data <<EOF other data EOF commit refs/heads/L committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT create L COMMIT M 644 :1 b. M 644 :1 b/other M 644 :1 ba commit refs/heads/L committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT update L COMMIT M 644 :2 b. M 644 :2 b/other M 644 :2 ba INPUT_END cat >expect <<EXPECT_END :100644 100644 4268632... 55d3a52... M b. :040000 040000 0ae5cac... 443c768... M b :100644 100644 4268632... 55d3a52... M ba EXPECT_END test_expect_success \ 'L: verify internal tree sorting' \ 'git fast-import <input && git diff-tree --abbrev --raw L^ L >output && test_cmp expect output' ### ### series M ### test_tick cat >input <<INPUT_END commit refs/heads/M1 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT file rename COMMIT from refs/heads/branch^0 R file2/newf file2/n.e.w.f INPUT_END cat >expect <<EOF :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 file2/newf file2/n.e.w.f EOF test_expect_success \ 'M: rename file in same subdirectory' \ 'git fast-import <input && git diff-tree -M -r M1^ M1 >actual && compare_diff_raw expect actual' cat >input <<INPUT_END commit refs/heads/M2 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT file rename COMMIT from refs/heads/branch^0 R file2/newf i/am/new/to/you INPUT_END cat >expect <<EOF :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 file2/newf i/am/new/to/you EOF test_expect_success \ 'M: rename file to new subdirectory' \ 'git fast-import <input && git diff-tree -M -r M2^ M2 >actual && compare_diff_raw expect actual' cat >input <<INPUT_END commit refs/heads/M3 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT file rename COMMIT from refs/heads/M2^0 R i other/sub INPUT_END cat >expect <<EOF :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 i/am/new/to/you other/sub/am/new/to/you EOF test_expect_success \ 'M: rename subdirectory to new subdirectory' \ 'git fast-import <input && git diff-tree -M -r M3^ M3 >actual && compare_diff_raw expect actual' ### ### series N ### test_tick cat >input <<INPUT_END commit refs/heads/N1 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT file copy COMMIT from refs/heads/branch^0 C file2/newf file2/n.e.w.f INPUT_END cat >expect <<EOF :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file2/n.e.w.f EOF test_expect_success \ 'N: copy file in same subdirectory' \ 'git fast-import <input && git diff-tree -C --find-copies-harder -r N1^ N1 >actual && compare_diff_raw expect actual' cat >input <<INPUT_END commit refs/heads/N2 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT clean directory copy COMMIT from refs/heads/branch^0 C file2 file3 commit refs/heads/N2 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT modify directory copy COMMIT M 644 inline file3/file5 data <<EOF $file5_data EOF INPUT_END cat >expect <<EOF :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100 newdir/interesting file3/file5 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file3/newf :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf file3/oldf EOF test_expect_success \ 'N: copy then modify subdirectory' \ 'git fast-import <input && git diff-tree -C --find-copies-harder -r N2^^ N2 >actual && compare_diff_raw expect actual' cat >input <<INPUT_END commit refs/heads/N3 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT dirty directory copy COMMIT from refs/heads/branch^0 M 644 inline file2/file5 data <<EOF $file5_data EOF C file2 file3 D file2/file5 INPUT_END test_expect_success \ 'N: copy dirty subdirectory' \ 'git fast-import <input && test `git rev-parse N2^{tree}` = `git rev-parse N3^{tree}`' test_expect_success \ 'N: copy directory by id' \ 'cat >expect <<-\EOF && :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file3/newf :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf file3/oldf EOF subdir=$(git rev-parse refs/heads/branch^0:file2) && cat >input <<-INPUT_END && commit refs/heads/N4 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT copy by tree hash COMMIT from refs/heads/branch^0 M 040000 $subdir file3 INPUT_END git fast-import <input && git diff-tree -C --find-copies-harder -r N4^ N4 >actual && compare_diff_raw expect actual' test_expect_success \ 'N: modify copied tree' \ 'cat >expect <<-\EOF && :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100 newdir/interesting file3/file5 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file3/newf :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf file3/oldf EOF subdir=$(git rev-parse refs/heads/branch^0:file2) && cat >input <<-INPUT_END && commit refs/heads/N5 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT copy by tree hash COMMIT from refs/heads/branch^0 M 040000 $subdir file3 commit refs/heads/N5 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT modify directory copy COMMIT M 644 inline file3/file5 data <<EOF $file5_data EOF INPUT_END git fast-import <input && git diff-tree -C --find-copies-harder -r N5^^ N5 >actual && compare_diff_raw expect actual' ### ### series O ### cat >input <<INPUT_END #we will commit refs/heads/O1 # -- ignore all of this text committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE # $GIT_COMMITTER_NAME has inserted here for his benefit. data <<COMMIT dirty directory copy COMMIT # don't forget the import blank line! # # yes, we started from our usual base of branch^0. # i like branch^0. from refs/heads/branch^0 # and we need to reuse file2/file5 from N3 above. M 644 inline file2/file5 # otherwise the tree will be different data <<EOF $file5_data EOF # don't forget to copy file2 to file3 C file2 file3 # # or to delete file5 from file2. D file2/file5 # are we done yet? INPUT_END test_expect_success \ 'O: comments are all skipped' \ 'git fast-import <input && test `git rev-parse N3` = `git rev-parse O1`' cat >input <<INPUT_END commit refs/heads/O2 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT dirty directory copy COMMIT from refs/heads/branch^0 M 644 inline file2/file5 data <<EOF $file5_data EOF C file2 file3 D file2/file5 INPUT_END test_expect_success \ 'O: blank lines not necessary after data commands' \ 'git fast-import <input && test `git rev-parse N3` = `git rev-parse O2`' test_expect_success \ 'O: repack before next test' \ 'git repack -a -d' cat >input <<INPUT_END commit refs/heads/O3 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT zstring COMMIT commit refs/heads/O3 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT zof COMMIT checkpoint commit refs/heads/O3 mark :5 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT zempty COMMIT checkpoint commit refs/heads/O3 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT zcommits COMMIT reset refs/tags/O3-2nd from :5 reset refs/tags/O3-3rd from :5 INPUT_END cat >expect <<INPUT_END string of empty commits INPUT_END test_expect_success \ 'O: blank lines not necessary after other commands' \ 'git fast-import <input && test 8 = `find .git/objects/pack -type f | wc -l` && test `git rev-parse refs/tags/O3-2nd` = `git rev-parse O3^` && git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual && test_cmp expect actual' cat >input <<INPUT_END commit refs/heads/O4 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT zstring COMMIT commit refs/heads/O4 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT zof COMMIT progress Two commits down, 2 to go! commit refs/heads/O4 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT zempty COMMIT progress Three commits down, 1 to go! commit refs/heads/O4 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT zcommits COMMIT progress I'm done! INPUT_END test_expect_success \ 'O: progress outputs as requested by input' \ 'git fast-import <input >actual && grep "progress " <input >expect && test_cmp expect actual' ### ### series P (gitlinks) ### cat >input <<INPUT_END blob mark :1 data 10 test file reset refs/heads/sub commit refs/heads/sub mark :2 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data 12 sub_initial M 100644 :1 file blob mark :3 data <<DATAEND [submodule "sub"] path = sub url = "`pwd`/sub" DATAEND commit refs/heads/subuse1 mark :4 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data 8 initial from refs/heads/master M 100644 :3 .gitmodules M 160000 :2 sub blob mark :5 data 20 test file more data commit refs/heads/sub mark :6 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data 11 sub_second from :2 M 100644 :5 file commit refs/heads/subuse1 mark :7 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data 7 second from :4 M 160000 :6 sub INPUT_END test_expect_success \ 'P: supermodule & submodule mix' \ 'git fast-import <input && git checkout subuse1 && rm -rf sub && mkdir sub && cd sub && git init && git fetch --update-head-ok .. refs/heads/sub:refs/heads/master && git checkout master && cd .. && git submodule init && git submodule update' SUBLAST=$(git rev-parse --verify sub) SUBPREV=$(git rev-parse --verify sub^) cat >input <<INPUT_END blob mark :1 data <<DATAEND [submodule "sub"] path = sub url = "`pwd`/sub" DATAEND commit refs/heads/subuse2 mark :2 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data 8 initial from refs/heads/master M 100644 :1 .gitmodules M 160000 $SUBPREV sub commit refs/heads/subuse2 mark :3 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data 7 second from :2 M 160000 $SUBLAST sub INPUT_END test_expect_success \ 'P: verbatim SHA gitlinks' \ 'git branch -D sub && git gc && git prune && git fast-import <input && test $(git rev-parse --verify subuse2) = $(git rev-parse --verify subuse1)' test_tick cat >input <<INPUT_END commit refs/heads/subuse3 mark :1 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT corrupt COMMIT from refs/heads/subuse2 M 160000 inline sub data <<DATA $SUBPREV DATA INPUT_END test_expect_success 'P: fail on inline gitlink' ' test_must_fail git fast-import <input' test_tick cat >input <<INPUT_END blob mark :1 data <<DATA $SUBPREV DATA commit refs/heads/subuse3 mark :2 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT corrupt COMMIT from refs/heads/subuse2 M 160000 :1 sub INPUT_END test_expect_success 'P: fail on blob mark in gitlink' ' test_must_fail git fast-import <input' ### ### series Q (notes) ### note1_data="The first note for the first commit" note2_data="The first note for the second commit" note3_data="The first note for the third commit" note1b_data="The second note for the first commit" note1c_data="The third note for the first commit" note2b_data="The second note for the second commit" test_tick cat >input <<INPUT_END blob mark :2 data <<EOF $file2_data EOF commit refs/heads/notes-test mark :3 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT first (:3) COMMIT M 644 :2 file2 blob mark :4 data $file4_len $file4_data commit refs/heads/notes-test mark :5 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT second (:5) COMMIT M 644 :4 file4 commit refs/heads/notes-test mark :6 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT third (:6) COMMIT M 644 inline file5 data <<EOF $file5_data EOF M 755 inline file6 data <<EOF $file6_data EOF blob mark :7 data <<EOF $note1_data EOF blob mark :8 data <<EOF $note2_data EOF commit refs/notes/foobar mark :9 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT notes (:9) COMMIT N :7 :3 N :8 :5 N inline :6 data <<EOF $note3_data EOF commit refs/notes/foobar mark :10 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT notes (:10) COMMIT N inline :3 data <<EOF $note1b_data EOF commit refs/notes/foobar2 mark :11 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT notes (:11) COMMIT N inline :3 data <<EOF $note1c_data EOF commit refs/notes/foobar mark :12 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT notes (:12) COMMIT deleteall N inline :5 data <<EOF $note2b_data EOF INPUT_END test_expect_success \ 'Q: commit notes' \ 'git fast-import <input && git whatchanged notes-test' test_expect_success \ 'Q: verify pack' \ 'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done' commit1=$(git rev-parse notes-test~2) commit2=$(git rev-parse notes-test^) commit3=$(git rev-parse notes-test) cat >expect <<EOF author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE first (:3) EOF test_expect_success \ 'Q: verify first commit' \ 'git cat-file commit notes-test~2 | sed 1d >actual && test_cmp expect actual' cat >expect <<EOF parent $commit1 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE second (:5) EOF test_expect_success \ 'Q: verify second commit' \ 'git cat-file commit notes-test^ | sed 1d >actual && test_cmp expect actual' cat >expect <<EOF parent $commit2 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE third (:6) EOF test_expect_success \ 'Q: verify third commit' \ 'git cat-file commit notes-test | sed 1d >actual && test_cmp expect actual' cat >expect <<EOF author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE notes (:9) EOF test_expect_success \ 'Q: verify first notes commit' \ 'git cat-file commit refs/notes/foobar~2 | sed 1d >actual && test_cmp expect actual' cat >expect.unsorted <<EOF 100644 blob $commit1 100644 blob $commit2 100644 blob $commit3 EOF cat expect.unsorted | sort >expect test_expect_success \ 'Q: verify first notes tree' \ 'git cat-file -p refs/notes/foobar~2^{tree} | sed "s/ [0-9a-f]* / /" >actual && test_cmp expect actual' echo "$note1_data" >expect test_expect_success \ 'Q: verify first note for first commit' \ 'git cat-file blob refs/notes/foobar~2:$commit1 >actual && test_cmp expect actual' echo "$note2_data" >expect test_expect_success \ 'Q: verify first note for second commit' \ 'git cat-file blob refs/notes/foobar~2:$commit2 >actual && test_cmp expect actual' echo "$note3_data" >expect test_expect_success \ 'Q: verify first note for third commit' \ 'git cat-file blob refs/notes/foobar~2:$commit3 >actual && test_cmp expect actual' cat >expect <<EOF parent `git rev-parse --verify refs/notes/foobar~2` author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE notes (:10) EOF test_expect_success \ 'Q: verify second notes commit' \ 'git cat-file commit refs/notes/foobar^ | sed 1d >actual && test_cmp expect actual' cat >expect.unsorted <<EOF 100644 blob $commit1 100644 blob $commit2 100644 blob $commit3 EOF cat expect.unsorted | sort >expect test_expect_success \ 'Q: verify second notes tree' \ 'git cat-file -p refs/notes/foobar^^{tree} | sed "s/ [0-9a-f]* / /" >actual && test_cmp expect actual' echo "$note1b_data" >expect test_expect_success \ 'Q: verify second note for first commit' \ 'git cat-file blob refs/notes/foobar^:$commit1 >actual && test_cmp expect actual' echo "$note2_data" >expect test_expect_success \ 'Q: verify first note for second commit' \ 'git cat-file blob refs/notes/foobar^:$commit2 >actual && test_cmp expect actual' echo "$note3_data" >expect test_expect_success \ 'Q: verify first note for third commit' \ 'git cat-file blob refs/notes/foobar^:$commit3 >actual && test_cmp expect actual' cat >expect <<EOF author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE notes (:11) EOF test_expect_success \ 'Q: verify third notes commit' \ 'git cat-file commit refs/notes/foobar2 | sed 1d >actual && test_cmp expect actual' cat >expect.unsorted <<EOF 100644 blob $commit1 EOF cat expect.unsorted | sort >expect test_expect_success \ 'Q: verify third notes tree' \ 'git cat-file -p refs/notes/foobar2^{tree} | sed "s/ [0-9a-f]* / /" >actual && test_cmp expect actual' echo "$note1c_data" >expect test_expect_success \ 'Q: verify third note for first commit' \ 'git cat-file blob refs/notes/foobar2:$commit1 >actual && test_cmp expect actual' cat >expect <<EOF parent `git rev-parse --verify refs/notes/foobar^` author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE notes (:12) EOF test_expect_success \ 'Q: verify fourth notes commit' \ 'git cat-file commit refs/notes/foobar | sed 1d >actual && test_cmp expect actual' cat >expect.unsorted <<EOF 100644 blob $commit2 EOF cat expect.unsorted | sort >expect test_expect_success \ 'Q: verify fourth notes tree' \ 'git cat-file -p refs/notes/foobar^{tree} | sed "s/ [0-9a-f]* / /" >actual && test_cmp expect actual' echo "$note2b_data" >expect test_expect_success \ 'Q: verify second note for second commit' \ 'git cat-file blob refs/notes/foobar:$commit2 >actual && test_cmp expect actual' ### ### series R (feature and option) ### cat >input <<EOF feature no-such-feature-exists EOF test_expect_success 'R: abort on unsupported feature' ' test_must_fail git fast-import <input ' cat >input <<EOF feature date-format=now EOF test_expect_success 'R: supported feature is accepted' ' git fast-import <input ' cat >input << EOF blob data 3 hi feature date-format=now EOF test_expect_success 'R: abort on receiving feature after data command' ' test_must_fail git fast-import <input ' cat >input << EOF feature import-marks=git.marks feature import-marks=git2.marks EOF test_expect_success 'R: only one import-marks feature allowed per stream' ' test_must_fail git fast-import <input ' cat >input << EOF feature export-marks=git.marks blob mark :1 data 3 hi EOF test_expect_success \ 'R: export-marks feature results in a marks file being created' \ 'cat input | git fast-import && grep :1 git.marks' test_expect_success \ 'R: export-marks options can be overriden by commandline options' \ 'cat input | git fast-import --export-marks=other.marks && grep :1 other.marks' cat >input << EOF feature import-marks=marks.out feature export-marks=marks.new EOF test_expect_success \ 'R: import to output marks works without any content' \ 'cat input | git fast-import && test_cmp marks.out marks.new' cat >input <<EOF feature import-marks=nonexistant.marks feature export-marks=marks.new EOF test_expect_success \ 'R: import marks prefers commandline marks file over the stream' \ 'cat input | git fast-import --import-marks=marks.out && test_cmp marks.out marks.new' cat >input <<EOF feature import-marks=nonexistant.marks feature export-marks=combined.marks EOF test_expect_success 'R: multiple --import-marks= should be honoured' ' head -n2 marks.out > one.marks && tail -n +3 marks.out > two.marks && git fast-import --import-marks=one.marks --import-marks=two.marks <input && test_cmp marks.out combined.marks ' cat >input <<EOF feature relative-marks feature import-marks=relative.in feature export-marks=relative.out EOF test_expect_success 'R: feature relative-marks should be honoured' ' mkdir -p .git/info/fast-import/ && cp marks.new .git/info/fast-import/relative.in && git fast-import <input && test_cmp marks.new .git/info/fast-import/relative.out ' cat >input <<EOF feature relative-marks feature import-marks=relative.in feature no-relative-marks feature export-marks=non-relative.out EOF test_expect_success 'R: feature no-relative-marks should be honoured' ' git fast-import <input && test_cmp marks.new non-relative.out ' cat >input << EOF option git quiet blob data 3 hi EOF touch empty test_expect_success 'R: quiet option results in no stats being output' ' cat input | git fast-import 2> output && test_cmp empty output ' cat >input <<EOF option git non-existing-option EOF test_expect_success 'R: die on unknown option' ' test_must_fail git fast-import <input ' test_expect_success 'R: unknown commandline options are rejected' '\ test_must_fail git fast-import --non-existing-option < /dev/null ' cat >input <<EOF option non-existing-vcs non-existing-option EOF test_expect_success 'R: ignore non-git options' ' git fast-import <input ' ## ## R: very large blobs ## blobsize=$((2*1024*1024 + 53)) test-genrandom bar $blobsize >expect cat >input <<INPUT_END commit refs/heads/big-file committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT R - big file COMMIT M 644 inline big1 data $blobsize INPUT_END cat expect >>input cat >>input <<INPUT_END M 644 inline big2 data $blobsize INPUT_END cat expect >>input echo >>input test_expect_success \ 'R: blob bigger than threshold' \ 'test_create_repo R && git --git-dir=R/.git fast-import --big-file-threshold=1 <input' test_expect_success \ 'R: verify created pack' \ ': >verify && for p in R/.git/objects/pack/*.pack; do git verify-pack -v $p >>verify || exit; done' test_expect_success \ 'R: verify written objects' \ 'git --git-dir=R/.git cat-file blob big-file:big1 >actual && test_cmp expect actual && a=$(git --git-dir=R/.git rev-parse big-file:big1) && b=$(git --git-dir=R/.git rev-parse big-file:big2) && test $a = $b' test_expect_success \ 'R: blob appears only once' \ 'n=$(grep $a verify | wc -l) && test 1 = $n' test_done
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
You can’t perform that action at this time.