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
4e3a1b2
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
t4135
t4252
t5100
t5515
t7004
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
harness
lib-cvs.sh
lib-git-svn.sh
lib-httpd.sh
lib-pager.sh
lib-patch-mode.sh
lib-prereq-FILEMODE.sh
lib-read-tree-m-3way.sh
lib-rebase.sh
lib-t6000.sh
lib-terminal.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
t0080-vcs-svn.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
t1412-reflog-loop.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
t1511-rev-parse-caret.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
t2006-checkout-index-basic.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
t2018-checkout-branch.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
t2107-update-index-basic.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
t3004-ls-files-basic.sh
t3010-ls-files-killed-modified.sh
t3020-ls-files-error-unmatch.sh
t3030-merge-recursive.sh
t3031-merge-criscross.sh
t3032-merge-recursive-options.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
t3308-notes-merge.sh
t3309-notes-merge-auto-resolve.sh
t3310-notes-merge-manual-resolve.sh
t3311-notes-merge-fanout.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
t3418-rebase-continue.sh
t3419-rebase-patch-id.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
t3509-cherry-pick-merge-df.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
t4045-diff-relative.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
t4111-apply-subdir.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
t4135-apply-weird-filenames.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
t4300-merge-tree.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
t5525-fetch-tagopt.sh
t5526-fetch-submodules.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
t6038-merge-text-auto.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
t6500-gc.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
t7609-merge-co-error-msgs.sh
t7610-mergetool.sh
t7611-merge-abort.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-corner-cases.sh
t8004-blame-with-conflicts.sh
t8005-blame-i18n.sh
t8006-blame-textconv.sh
t8007-cat-file-textconv.sh
t9001-send-email.sh
t9010-svn-fe.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
t9155-git-svn-fetch-deleted-tag.sh
t9156-git-svn-fetch-deleted-tag-2.sh
t9157-git-svn-fetch-merge.sh
t9158-git-svn-mergeinfo.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
test-terminal.perl
test4012.png
test9200a.png
test9200b.png
templates
vcs-svn
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-merge.c
notes-merge.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-line-buffer.c
test-match-trees.c
test-obj-pool.c
test-parse-options.c
test-path-utils.c
test-run-command.c
test-sha1.c
test-sha1.sh
test-sigchain.c
test-string-pool.c
test-svn-fe.c
test-treap.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
zlib.c
Breadcrumbs
git
/
t
/
test-lib.sh
Blame
Blame
Latest commit
History
History
1078 lines (975 loc) · 25 KB
Breadcrumbs
git
/
t
/
test-lib.sh
Top
File metadata and controls
Code
Blame
1078 lines (975 loc) · 25 KB
Raw
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/ . # if --tee was passed, write the output not only to the terminal, but # additionally to the file test-results/$BASENAME.out, too. case "$GIT_TEST_TEE_STARTED, $* " in done,*) # do not redirect again ;; *' --tee '*|*' --va'*) mkdir -p test-results BASE=test-results/$(basename "$0" .sh) (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1; echo $? > $BASE.exit) | tee $BASE.out test "$(cat $BASE.exit)" = 0 exit ;; esac # Keep the original TERM for say_color ORIGINAL_TERM=$TERM # For repeatability, reset the environment to known value. LANG=C LC_ALL=C PAGER=cat TZ=UTC TERM=dumb export LANG LC_ALL PAGER TERM TZ EDITOR=: unset VISUAL unset GIT_EDITOR unset AUTHOR_DATE unset AUTHOR_EMAIL unset AUTHOR_NAME unset COMMIT_AUTHOR_EMAIL unset COMMIT_AUTHOR_NAME unset EMAIL unset GIT_ALTERNATE_OBJECT_DIRECTORIES unset GIT_AUTHOR_DATE GIT_AUTHOR_EMAIL=author@example.com GIT_AUTHOR_NAME='A U Thor' unset GIT_COMMITTER_DATE GIT_COMMITTER_EMAIL=committer@example.com GIT_COMMITTER_NAME='C O Mitter' unset GIT_DIFF_OPTS unset GIT_DIR unset GIT_WORK_TREE unset GIT_EXTERNAL_DIFF unset GIT_INDEX_FILE unset GIT_OBJECT_DIRECTORY unset GIT_CEILING_DIRECTORIES unset SHA1_FILE_DIRECTORIES unset SHA1_FILE_DIRECTORY unset GIT_NOTES_REF unset GIT_NOTES_DISPLAY_REF unset GIT_NOTES_REWRITE_REF unset GIT_NOTES_REWRITE_MODE GIT_MERGE_VERBOSITY=5 export GIT_MERGE_VERBOSITY export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME export EDITOR # Protect ourselves from common misconfiguration to export # CDPATH into the environment unset CDPATH unset GREP_OPTIONS case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in 1|2|true) echo "* warning: Some tests will not work if GIT_TRACE" \ "is set as to trace on STDERR ! *" echo "* warning: Please set GIT_TRACE to something" \ "other than 1, 2 or true ! *" ;; esac # Convenience # # A regexp to match 5 and 40 hexdigits _x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05" # Each test should start with something like this, after copyright notices: # # test_description='Description of this test... # This test checks if command xyzzy does the right thing... # ' # . ./test-lib.sh [ "x$ORIGINAL_TERM" != "xdumb" ] && ( TERM=$ORIGINAL_TERM && export TERM && [ -t 1 ] && tput bold >/dev/null 2>&1 && tput setaf 1 >/dev/null 2>&1 && tput sgr0 >/dev/null 2>&1 ) && color=t while test "$#" -ne 0 do case "$1" in -d|--d|--de|--deb|--debu|--debug) debug=t; shift ;; -i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate) immediate=t; shift ;; -l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests) GIT_TEST_LONG=t; export GIT_TEST_LONG; shift ;; -h|--h|--he|--hel|--help) help=t; shift ;; -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose) verbose=t; shift ;; -q|--q|--qu|--qui|--quie|--quiet) # Ignore --quiet under a TAP::Harness. Saying how many tests # passed without the ok/not ok details is always an error. test -z "$HARNESS_ACTIVE" && quiet=t; shift ;; --with-dashes) with_dashes=t; shift ;; --no-color) color=; shift ;; --va|--val|--valg|--valgr|--valgri|--valgrin|--valgrind) valgrind=t; verbose=t; shift ;; --tee) shift ;; # was handled already --root=*) root=$(expr "z$1" : 'z[^=]*=\(.*\)') shift ;; *) echo "error: unknown test option '$1'" >&2; exit 1 ;; esac done if test -n "$color"; then say_color () { ( TERM=$ORIGINAL_TERM export TERM case "$1" in error) tput bold; tput setaf 1;; # bold red skip) tput bold; tput setaf 2;; # bold green pass) tput setaf 2;; # green info) tput setaf 3;; # brown *) test -n "$quiet" && return;; esac shift printf "%s" "$*" tput sgr0 echo ) } else say_color() { test -z "$1" && test -n "$quiet" && return shift echo "$*" } fi error () { say_color error "error: $*" GIT_EXIT_OK=t exit 1 } say () { say_color info "$*" } test "${test_description}" != "" || error "Test script did not set test_description." if test "$help" = "t" then echo "$test_description" exit 0 fi exec 5>&1 if test "$verbose" = "t" then exec 4>&2 3>&1 else exec 4>/dev/null 3>/dev/null fi test_failure=0 test_count=0 test_fixed=0 test_broken=0 test_success=0 test_external_has_tap=0 die () { code=$? if test -n "$GIT_EXIT_OK" then exit $code else echo >&5 "FATAL: Unexpected exit with code $code" exit 1 fi } GIT_EXIT_OK= trap 'die' EXIT # The semantics of the editor variables are that of invoking # sh -c "$EDITOR \"$@\"" files ... # # If our trash directory contains shell metacharacters, they will be # interpreted if we just set $EDITOR directly, so do a little dance with # environment variables to work around this. # # In particular, quoting isn't enough, as the path may contain the same quote # that we're using. test_set_editor () { FAKE_EDITOR="$1" export FAKE_EDITOR EDITOR='"$FAKE_EDITOR"' export EDITOR } test_decode_color () { awk ' function name(n) { if (n == 0) return "RESET"; if (n == 1) return "BOLD"; if (n == 30) return "BLACK"; if (n == 31) return "RED"; if (n == 32) return "GREEN"; if (n == 33) return "YELLOW"; if (n == 34) return "BLUE"; if (n == 35) return "MAGENTA"; if (n == 36) return "CYAN"; if (n == 37) return "WHITE"; if (n == 40) return "BLACK"; if (n == 41) return "BRED"; if (n == 42) return "BGREEN"; if (n == 43) return "BYELLOW"; if (n == 44) return "BBLUE"; if (n == 45) return "BMAGENTA"; if (n == 46) return "BCYAN"; if (n == 47) return "BWHITE"; } { while (match($0, /\033\[[0-9;]*m/) != 0) { printf "%s<", substr($0, 1, RSTART-1); codes = substr($0, RSTART+2, RLENGTH-3); if (length(codes) == 0) printf "%s", name(0) else { n = split(codes, ary, ";"); sep = ""; for (i = 1; i <= n; i++) { printf "%s%s", sep, name(ary[i]); sep = ";" } } printf ">"; $0 = substr($0, RSTART + RLENGTH, length($0) - RSTART - RLENGTH + 1); } print } ' } nul_to_q () { perl -pe 'y/\000/Q/' } q_to_nul () { perl -pe 'y/Q/\000/' } q_to_cr () { tr Q '\015' } q_to_tab () { tr Q '\011' } append_cr () { sed -e 's/$/Q/' | tr Q '\015' } remove_cr () { tr '\015' Q | sed -e 's/Q$//' } # In some bourne shell implementations, the "unset" builtin returns # nonzero status when a variable to be unset was not set in the first # place. # # Use sane_unset when that should not be considered an error. sane_unset () { unset "$@" return 0 } test_tick () { if test -z "${test_tick+set}" then test_tick=1112911993 else test_tick=$(($test_tick + 60)) fi GIT_COMMITTER_DATE="$test_tick -0700" GIT_AUTHOR_DATE="$test_tick -0700" export GIT_COMMITTER_DATE GIT_AUTHOR_DATE } # Call test_commit with the arguments "<message> [<file> [<contents>]]" # # This will commit a file with the given contents and the given commit # message. It will also add a tag with <message> as name. # # Both <file> and <contents> default to <message>. test_commit () { file=${2:-"$1.t"} echo "${3-$1}" > "$file" && git add "$file" && test_tick && git commit -m "$1" && git tag "$1" } # Call test_merge with the arguments "<message> <commit>", where <commit> # can be a tag pointing to the commit-to-merge. test_merge () { test_tick && git merge -m "$1" "$2" && git tag "$1" } # This function helps systems where core.filemode=false is set. # Use it instead of plain 'chmod +x' to set or unset the executable bit # of a file in the working directory and add it to the index. test_chmod () { chmod "$@" && git update-index --add "--chmod=$@" } # Use test_set_prereq to tell that a particular prerequisite is available. # The prerequisite can later be checked for in two ways: # # - Explicitly using test_have_prereq. # # - Implicitly by specifying the prerequisite tag in the calls to # test_expect_{success,failure,code}. # # The single parameter is the prerequisite tag (a simple word, in all # capital letters by convention). test_set_prereq () { satisfied="$satisfied$1 " } satisfied=" " test_have_prereq () { # prerequisites can be concatenated with ',' save_IFS=$IFS IFS=, set -- $* IFS=$save_IFS total_prereq=0 ok_prereq=0 missing_prereq= for prerequisite do total_prereq=$(($total_prereq + 1)) case $satisfied in *" $prerequisite "*) ok_prereq=$(($ok_prereq + 1)) ;; *) # Keep a list of missing prerequisites if test -z "$missing_prereq" then missing_prereq=$prerequisite else missing_prereq="$prerequisite,$missing_prereq" fi esac done test $total_prereq = $ok_prereq } test_declared_prereq () { case ",$test_prereq," in *,$1,*) return 0 ;; esac return 1 } # You are not expected to call test_ok_ and test_failure_ directly, use # the text_expect_* functions instead. test_ok_ () { test_success=$(($test_success + 1)) say_color "" "ok $test_count - $@" } test_failure_ () { test_failure=$(($test_failure + 1)) say_color error "not ok - $test_count $1" shift echo "$@" | sed -e 's/^/# /' test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; } } test_known_broken_ok_ () { test_fixed=$(($test_fixed+1)) say_color "" "ok $test_count - $@ # TODO known breakage" } test_known_broken_failure_ () { test_broken=$(($test_broken+1)) say_color skip "not ok $test_count - $@ # TODO known breakage" } test_debug () { test "$debug" = "" || eval "$1" } test_run_ () { test_cleanup=: eval >&3 2>&4 "$1" eval_ret=$? eval >&3 2>&4 "$test_cleanup" if test "$verbose" = "t" && test -n "$HARNESS_ACTIVE"; then echo "" fi return 0 } test_skip () { test_count=$(($test_count+1)) to_skip= for skp in $GIT_SKIP_TESTS do case $this_test.$test_count in $skp) to_skip=t break esac done if test -z "$to_skip" && test -n "$test_prereq" && ! test_have_prereq "$test_prereq" then to_skip=t fi case "$to_skip" in t) of_prereq= if test "$missing_prereq" != "$test_prereq" then of_prereq=" of $test_prereq" fi say_color skip >&3 "skipping test: $@" say_color skip "ok $test_count # skip $1 (missing $missing_prereq${of_prereq})" : true ;; *) false ;; esac } test_expect_failure () { test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq= test "$#" = 2 || error "bug in the test script: not 2 or 3 parameters to test-expect-failure" export test_prereq if ! test_skip "$@" then say >&3 "checking known breakage: $2" test_run_ "$2" if [ "$?" = 0 -a "$eval_ret" = 0 ] then test_known_broken_ok_ "$1" else test_known_broken_failure_ "$1" fi fi echo >&3 "" } test_expect_success () { test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq= test "$#" = 2 || error "bug in the test script: not 2 or 3 parameters to test-expect-success" export test_prereq if ! test_skip "$@" then say >&3 "expecting success: $2" test_run_ "$2" if [ "$?" = 0 -a "$eval_ret" = 0 ] then test_ok_ "$1" else test_failure_ "$@" fi fi echo >&3 "" } # test_external runs external test scripts that provide continuous # test output about their progress, and succeeds/fails on # zero/non-zero exit code. It outputs the test output on stdout even # in non-verbose mode, and announces the external script with "# run # <n>: ..." before running it. When providing relative paths, keep in # mind that all scripts run in "trash directory". # Usage: test_external description command arguments... # Example: test_external 'Perl API' perl ../path/to/test.pl test_external () { test "$#" = 4 && { test_prereq=$1; shift; } || test_prereq= test "$#" = 3 || error >&5 "bug in the test script: not 3 or 4 parameters to test_external" descr="$1" shift export test_prereq if ! test_skip "$descr" "$@" then # Announce the script to reduce confusion about the # test output that follows. say_color "" "# run $test_count: $descr ($*)" # Export TEST_DIRECTORY, TRASH_DIRECTORY and GIT_TEST_LONG # to be able to use them in script export TEST_DIRECTORY TRASH_DIRECTORY GIT_TEST_LONG # Run command; redirect its stderr to &4 as in # test_run_, but keep its stdout on our stdout even in # non-verbose mode. "$@" 2>&4 if [ "$?" = 0 ] then if test $test_external_has_tap -eq 0; then test_ok_ "$descr" else say_color "" "# test_external test $descr was ok" test_success=$(($test_success + 1)) fi else if test $test_external_has_tap -eq 0; then test_failure_ "$descr" "$@" else say_color error "# test_external test $descr failed: $@" test_failure=$(($test_failure + 1)) fi fi fi } # Like test_external, but in addition tests that the command generated # no output on stderr. test_external_without_stderr () { # The temporary file has no (and must have no) security # implications. tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi stderr="$tmp/git-external-stderr.$$.tmp" test_external "$@" 4> "$stderr" [ -f "$stderr" ] || error "Internal error: $stderr disappeared." descr="no stderr: $1" shift say >&3 "# expecting no stderr from previous command" if [ ! -s "$stderr" ]; then rm "$stderr" if test $test_external_has_tap -eq 0; then test_ok_ "$descr" else say_color "" "# test_external_without_stderr test $descr was ok" test_success=$(($test_success + 1)) fi else if [ "$verbose" = t ]; then output=`echo; echo "# Stderr is:"; cat "$stderr"` else output= fi # rm first in case test_failure exits. rm "$stderr" if test $test_external_has_tap -eq 0; then test_failure_ "$descr" "$@" "$output" else say_color error "# test_external_without_stderr test $descr failed: $@: $output" test_failure=$(($test_failure + 1)) fi fi } # debugging-friendly alternatives to "test [-f|-d|-e]" # The commands test the existence or non-existence of $1. $2 can be # given to provide a more precise diagnosis. test_path_is_file () { if ! [ -f "$1" ] then echo "File $1 doesn't exist. $*" false fi } test_path_is_dir () { if ! [ -d "$1" ] then echo "Directory $1 doesn't exist. $*" false fi } test_path_is_missing () { if [ -e "$1" ] then echo "Path exists:" ls -ld "$1" if [ $# -ge 1 ]; then echo "$*" fi false fi } # test_line_count checks that a file has the number of lines it # ought to. For example: # # test_expect_success 'produce exactly one line of output' ' # do something >output && # test_line_count = 1 output # ' # # is like "test $(wc -l <output) = 1" except that it passes the # output through when the number of lines is wrong. test_line_count () { if test $# != 3 then error "bug in the test script: not 3 parameters to test_line_count" elif ! test $(wc -l <"$3") "$1" "$2" then echo "test_line_count: line count for $3 !$1 $2" cat "$3" return 1 fi } # This is not among top-level (test_expect_success | test_expect_failure) # but is a prefix that can be used in the test script, like: # # test_expect_success 'complain and die' ' # do something && # do something else && # test_must_fail git checkout ../outerspace # ' # # Writing this as "! git checkout ../outerspace" is wrong, because # the failure could be due to a segv. We want a controlled failure. test_must_fail () { "$@" exit_code=$? if test $exit_code = 0; then echo >&2 "test_must_fail: command succeeded: $*" return 1 elif test $exit_code -gt 129 -a $exit_code -le 192; then echo >&2 "test_must_fail: died by signal: $*" return 1 elif test $exit_code = 127; then echo >&2 "test_must_fail: command not found: $*" return 1 fi return 0 } # Similar to test_must_fail, but tolerates success, too. This is # meant to be used in contexts like: # # test_expect_success 'some command works without configuration' ' # test_might_fail git config --unset all.configuration && # do something # ' # # Writing "git config --unset all.configuration || :" would be wrong, # because we want to notice if it fails due to segv. test_might_fail () { "$@" exit_code=$? if test $exit_code -gt 129 -a $exit_code -le 192; then echo >&2 "test_might_fail: died by signal: $*" return 1 elif test $exit_code = 127; then echo >&2 "test_might_fail: command not found: $*" return 1 fi return 0 } # Similar to test_must_fail and test_might_fail, but check that a # given command exited with a given exit code. Meant to be used as: # # test_expect_success 'Merge with d/f conflicts' ' # test_expect_code 1 git merge "merge msg" B master # ' test_expect_code () { want_code=$1 shift "$@" exit_code=$? if test $exit_code = $want_code then echo >&2 "test_expect_code: command exited with $exit_code: $*" return 0 else echo >&2 "test_expect_code: command exited with $exit_code, we wanted $want_code $*" return 1 fi } # test_cmp is a helper function to compare actual and expected output. # You can use it like: # # test_expect_success 'foo works' ' # echo expected >expected && # foo >actual && # test_cmp expected actual # ' # # This could be written as either "cmp" or "diff -u", but: # - cmp's output is not nearly as easy to read as diff -u # - not all diff versions understand "-u" test_cmp() { $GIT_TEST_CMP "$@" } # This function can be used to schedule some commands to be run # unconditionally at the end of the test to restore sanity: # # test_expect_success 'test core.capslock' ' # git config core.capslock true && # test_when_finished "git config --unset core.capslock" && # hello world # ' # # That would be roughly equivalent to # # test_expect_success 'test core.capslock' ' # git config core.capslock true && # hello world # git config --unset core.capslock # ' # # except that the greeting and config --unset must both succeed for # the test to pass. test_when_finished () { test_cleanup="{ $* } && (exit \"\$eval_ret\"); eval_ret=\$?; $test_cleanup" } # Most tests can use the created repository, but some may need to create more. # Usage: test_create_repo <directory> test_create_repo () { test "$#" = 1 || error "bug in the test script: not 1 parameter to test-create-repo" repo="$1" mkdir -p "$repo" ( cd "$repo" || error "Cannot setup test environment" "$GIT_EXEC_PATH/git-init" "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 || error "cannot run git init -- have you built things yet?" mv .git/hooks .git/hooks-disabled ) || exit } test_done () { GIT_EXIT_OK=t if test -z "$HARNESS_ACTIVE"; then test_results_dir="$TEST_DIRECTORY/test-results" mkdir -p "$test_results_dir" test_results_path="$test_results_dir/${0%.sh}-$$.counts" echo "total $test_count" >> $test_results_path echo "success $test_success" >> $test_results_path echo "fixed $test_fixed" >> $test_results_path echo "broken $test_broken" >> $test_results_path echo "failed $test_failure" >> $test_results_path echo "" >> $test_results_path fi if test "$test_fixed" != 0 then say_color pass "# fixed $test_fixed known breakage(s)" fi if test "$test_broken" != 0 then say_color error "# still have $test_broken known breakage(s)" msg="remaining $(($test_count-$test_broken)) test(s)" else msg="$test_count test(s)" fi case "$test_failure" in 0) # Maybe print SKIP message [ -z "$skip_all" ] || skip_all=" # SKIP $skip_all" if test $test_external_has_tap -eq 0; then say_color pass "# passed all $msg" say "1..$test_count$skip_all" fi test -d "$remove_trash" && cd "$(dirname "$remove_trash")" && rm -rf "$(basename "$remove_trash")" exit 0 ;; *) if test $test_external_has_tap -eq 0; then say_color error "# failed $test_failure among $msg" say "1..$test_count" fi exit 1 ;; esac } # Test the binaries we have just built. The tests are kept in # t/ subdirectory and are run in 'trash directory' subdirectory. if test -z "$TEST_DIRECTORY" then # We allow tests to override this, in case they want to run tests # outside of t/, e.g. for running tests on the test library # itself. TEST_DIRECTORY=$(pwd) fi GIT_BUILD_DIR="$TEST_DIRECTORY"/.. if test -n "$valgrind" then make_symlink () { test -h "$2" && test "$1" = "$(readlink "$2")" || { # be super paranoid if mkdir "$2".lock then rm -f "$2" && ln -s "$1" "$2" && rm -r "$2".lock else while test -d "$2".lock do say "Waiting for lock on $2." sleep 1 done fi } } make_valgrind_symlink () { # handle only executables test -x "$1" || return base=$(basename "$1") symlink_target=$GIT_BUILD_DIR/$base # do not override scripts if test -x "$symlink_target" && test ! -d "$symlink_target" && test "#!" != "$(head -c 2 < "$symlink_target")" then symlink_target=../valgrind.sh fi case "$base" in *.sh|*.perl) symlink_target=../unprocessed-script esac # create the link, or replace it if it is out of date make_symlink "$symlink_target" "$GIT_VALGRIND/bin/$base" || exit } # override all git executables in TEST_DIRECTORY/.. GIT_VALGRIND=$TEST_DIRECTORY/valgrind mkdir -p "$GIT_VALGRIND"/bin for file in $GIT_BUILD_DIR/git* $GIT_BUILD_DIR/test-* do make_valgrind_symlink $file done OLDIFS=$IFS IFS=: for path in $PATH do ls "$path"/git-* 2> /dev/null | while read file do make_valgrind_symlink "$file" done done IFS=$OLDIFS PATH=$GIT_VALGRIND/bin:$PATH GIT_EXEC_PATH=$GIT_VALGRIND/bin export GIT_VALGRIND elif test -n "$GIT_TEST_INSTALLED" ; then GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) || error "Cannot run git from $GIT_TEST_INSTALLED." PATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR:$PATH GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH} else # normal case, use ../bin-wrappers only unless $with_dashes: git_bin_dir="$GIT_BUILD_DIR/bin-wrappers" if ! test -x "$git_bin_dir/git" ; then if test -z "$with_dashes" ; then say "$git_bin_dir/git is not executable; using GIT_EXEC_PATH" fi with_dashes=t fi PATH="$git_bin_dir:$PATH" GIT_EXEC_PATH=$GIT_BUILD_DIR if test -n "$with_dashes" ; then PATH="$GIT_BUILD_DIR:$PATH" fi fi GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt unset GIT_CONFIG GIT_CONFIG_NOSYSTEM=1 GIT_CONFIG_NOGLOBAL=1 export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS if test -z "$GIT_TEST_CMP" then if test -n "$GIT_TEST_CMP_USE_COPIED_CONTEXT" then GIT_TEST_CMP="$DIFF -c" else GIT_TEST_CMP="$DIFF -u" fi fi GITPERLLIB="$GIT_BUILD_DIR"/perl/blib/lib:"$GIT_BUILD_DIR"/perl/blib/arch/auto/Git export GITPERLLIB test -d "$GIT_BUILD_DIR"/templates/blt || { error "You haven't built things yet, have you?" } if test -z "$GIT_TEST_INSTALLED" && test -z "$NO_PYTHON" then GITPYTHONLIB="$GIT_BUILD_DIR/git_remote_helpers/build/lib" export GITPYTHONLIB test -d "$GIT_BUILD_DIR"/git_remote_helpers/build || { error "You haven't built git_remote_helpers yet, have you?" } fi if ! test -x "$GIT_BUILD_DIR"/test-chmtime; then echo >&2 'You need to build test-chmtime:' echo >&2 'Run "make test-chmtime" in the source (toplevel) directory' exit 1 fi # Test repository test="trash directory.$(basename "$0" .sh)" test -n "$root" && test="$root/$test" case "$test" in /*) TRASH_DIRECTORY="$test" ;; *) TRASH_DIRECTORY="$TEST_DIRECTORY/$test" ;; esac test ! -z "$debug" || remove_trash=$TRASH_DIRECTORY rm -fr "$test" || { GIT_EXIT_OK=t echo >&5 "FATAL: Cannot prepare test area" exit 1 } test_create_repo "$test" # Use -P to resolve symlinks in our working directory so that the cwd # in subprocesses like git equals our $PWD (for pathname comparisons). cd -P "$test" || exit 1 HOME=$(pwd) export HOME this_test=${0##*/} this_test=${this_test%%-*} for skp in $GIT_SKIP_TESTS do case "$this_test" in $skp) say_color skip >&3 "skipping test $this_test altogether" skip_all="skip all tests in $this_test" test_done esac done # Provide an implementation of the 'yes' utility yes () { if test $# = 0 then y=y else y="$*" fi while echo "$y" do : done } # Fix some commands on Windows case $(uname -s) in *MINGW*) # Windows has its own (incompatible) sort and find sort () { /usr/bin/sort "$@" } find () { /usr/bin/find "$@" } sum () { md5sum "$@" } # git sees Windows-style pwd pwd () { builtin pwd -W } # no POSIX permissions # backslashes in pathspec are converted to '/' # exec does not inherit the PID test_set_prereq MINGW ;; *) test_set_prereq POSIXPERM test_set_prereq BSLASHPSPEC test_set_prereq EXECKEEPSPID test_set_prereq NOT_MINGW ;; esac test -z "$NO_PERL" && test_set_prereq PERL test -z "$NO_PYTHON" && test_set_prereq PYTHON # test whether the filesystem supports symbolic links ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS rm -f y # When the tests are run as root, permission tests will report that # things are writable when they shouldn't be. test -w / || test_set_prereq SANITY
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
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
You can’t perform that action at this time.