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
113bc16
Documentation
block-sha1
builtin
compat
contrib
ewah
git-gui
gitk-git
gitweb
mergetools
perl
po
ppc
t
Git-SVN
diff-lib
lib-gpg
lib-httpd
perf
t0110
t0200
t0202
t1509
t3900
t4013
t4018
t4020
t4034
t4100
t4101
t4109
t4110
t4135
t4211
t4252
t5000
t5003
t5004
t5100
t5515
t7500
t8005
t9110
t9111
t9115
t9121
t9126
t9135
t9136
t9150
t9151
t9153
t9154
t9161
t9601
t9602
t9603
t9604
t9700
valgrind
.gitattributes
.gitignore
Makefile
README
aggregate-results.sh
annotate-tests.sh
check-non-portable-shell.pl
diff-lib.sh
gitweb-lib.sh
lib-bash.sh
lib-credential.sh
lib-cvs.sh
lib-diff-alternative.sh
lib-gettext.sh
lib-git-daemon.sh
lib-git-p4.sh
lib-git-svn.sh
lib-gpg.sh
lib-httpd.sh
lib-pack.sh
lib-pager.sh
lib-patch-mode.sh
lib-read-tree-m-3way.sh
lib-read-tree.sh
lib-rebase.sh
lib-submodule-update.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
t0007-git-var.sh
t0008-ignores.sh
t0009-prio-queue.sh
t0010-racy-git.sh
t0011-hashmap.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
t0027-auto-crlf.sh
t0030-stripspace.sh
t0040-parse-options.sh
t0050-filesystem.sh
t0055-beyond-symlinks.sh
t0056-git-C.sh
t0060-path-utils.sh
t0061-run-command.sh
t0062-revision-walking.sh
t0063-string-list.sh
t0064-sha1-array.sh
t0070-fundamental.sh
t0081-line-buffer.sh
t0090-cache-tree.sh
t0100-previous.sh
t0101-at-syntax.sh
t0110-urlmatch-normalization.sh
t0200-gettext-basic.sh
t0201-gettext-fallbacks.sh
t0202-gettext-perl.sh
t0203-gettext-setlocale-sanity.sh
t0204-gettext-reencode-sanity.sh
t0205-gettext-poison.sh
t0300-credentials.sh
t0301-credential-cache.sh
t0302-credential-store.sh
t0303-credential-external.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
t1013-read-tree-submodule.sh
t1014-read-tree-confusing.sh
t1020-subdirectory.sh
t1021-rerere-in-workdir.sh
t1050-large.sh
t1051-large-conversion.sh
t1060-object-corruption.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
t1305-config-include.sh
t1306-xdg-files.sh
t1307-config-blob.sh
t1308-config-set.sh
t1400-update-ref.sh
t1401-symbolic-ref.sh
t1402-check-ref-format.sh
t1403-show-ref.sh
t1410-reflog.sh
t1411-reflog-show.sh
t1412-reflog-loop.sh
t1413-reflog-detach.sh
t1420-lost-found.sh
t1430-bad-ref-name.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
t1510-repo-setup.sh
t1511-rev-parse-caret.sh
t1512-rev-parse-disambiguation.sh
t1513-rev-parse-prefix.sh
t1600-index.sh
t1700-split-index.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
t2019-checkout-ambiguous-ref.sh
t2020-checkout-detach.sh
t2021-checkout-overwrite.sh
t2022-checkout-paths.sh
t2023-checkout-m.sh
t2024-checkout-dwim.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
t3005-ls-files-relative.sh
t3006-ls-files-long.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
t3070-wildmatch.sh
t3100-ls-tree-restrict.sh
t3101-ls-tree-dirname.sh
t3102-ls-tree-wildcards.sh
t3103-ls-tree-misc.sh
t3200-branch.sh
t3201-branch-contains.sh
t3202-show-branch-octopus.sh
t3203-branch-output.sh
t3210-pack-refs.sh
t3211-peel-ref.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
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
t3420-rebase-autostash.sh
t3421-rebase-topology-linear.sh
t3425-rebase-topology-merges.sh
t3426-rebase-submodule.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
t3510-cherry-pick-sequence.sh
t3511-cherry-pick-x.sh
t3512-cherry-pick-submodule.sh
t3513-revert-submodule.sh
t3600-rm.sh
t3700-add.sh
t3701-add-interactive.sh
t3702-add-edit.sh
t3703-add-magic-pathspec.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
t3905-stash-include-untracked.sh
t3906-stash-submodule.sh
t3910-mac-os-precompose.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
t4046-diff-unmerged.sh
t4047-diff-dirstat.sh
t4048-diff-combined-binary.sh
t4049-diff-stat-count.sh
t4050-diff-histogram.sh
t4051-diff-function-context.sh
t4052-stat-output.sh
t4053-diff-no-index.sh
t4054-diff-bogus-tree.sh
t4055-diff-context.sh
t4056-diff-order.sh
t4057-diff-combined-paths.sh
t4058-diff-duplicates.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
t4108-apply-threeway.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
t4136-apply-check.sh
t4137-apply-submodule.sh
t4138-apply-ws-expansion.sh
t4139-apply-escape.sh
t4150-am.sh
t4151-am-abort.sh
t4152-am-subjects.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
t4208-log-magic-pathspec.sh
t4209-log-pickaxe.sh
t4210-log-i18n.sh
t4211-line-log.sh
t4212-log-corrupt.sh
t4252-am-options.sh
t4253-am-keep-cr-dos.sh
t4254-am-corrupt.sh
t4255-am-submodule.sh
t4300-merge-tree.sh
t5000-tar-tree.sh
t5001-archive-attr.sh
t5002-archive-attr-pattern.sh
t5003-archive-zip.sh
t5004-archive-corner-cases.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
t5308-pack-detect-duplicates.sh
t5309-pack-delta-cycles.sh
t5310-pack-bitmaps.sh
t5311-pack-bitmaps-shallow.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
t5408-send-pack-stdin.sh
t5500-fetch-pack.sh
t5501-fetch-push-alternates.sh
t5502-quickfetch.sh
t5503-tagfollow.sh
t5504-fetch-receive-strict.sh
t5505-remote.sh
t5506-remote-groups.sh
t5509-fetch-push-namespaces.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
t5527-fetch-odd-refs.sh
t5528-push-default.sh
t5529-push-errors.sh
t5530-upload-pack-error.sh
t5531-deep-submodule-push.sh
t5532-fetch-proxy.sh
t5533-push-cas.sh
t5534-push-signed.sh
t5535-fetch-push-symref.sh
t5536-fetch-conflicts.sh
t5537-fetch-shallow.sh
t5538-push-shallow.sh
t5539-fetch-http-shallow.sh
t5540-http-push-webdav.sh
t5541-http-push-smart.sh
t5542-push-http-shallow.sh
t5550-http-fetch-dumb.sh
t5551-http-fetch-smart.sh
t5560-http-backend-noserver.sh
t5561-http-backend.sh
t556x_common
t5570-git-daemon.sh
t5571-pre-push-hook.sh
t5572-pull-submodule.sh
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
t5707-clone-detached.sh
t5708-clone-config.sh
t5709-clone-refspec.sh
t5710-info-alternate.sh
t5801-remote-helpers.sh
t5802-connect-helper.sh
t5900-repo-selection.sh
t6000-rev-list-misc.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
t6039-merge-ignorecase.sh
t6040-tracking-info.sh
t6041-bisect-submodule.sh
t6042-merge-rename-corner-cases.sh
t6050-replace.sh
t6060-merge-index.sh
t6101-rev-parse-parents.sh
t6110-rev-list-sparse.sh
t6111-rev-list-treesame.sh
t6120-describe.sh
t6130-pathspec-noglob.sh
t6131-pathspec-icase.sh
t6132-pathspec-exclude.sh
t6200-fmt-merge-msg.sh
t6300-for-each-ref.sh
t6500-gc.sh
t6501-freshen-objects.sh
t7001-mv.sh
t7003-filter-branch.sh
t7004-tag.sh
t7005-editor.sh
t7006-pager.sh
t7007-show.sh
t7008-grep-binary.sh
t7009-filter-branch-null-sha1.sh
t7010-setup.sh
t7011-skip-worktree-reading.sh
t7012-skip-worktree-writing.sh
t7060-wtstatus.sh
t7061-wtstatus-ignore.sh
t7062-wtstatus-ignorecase.sh
t7101-reset-empty-subdirs.sh
t7102-reset.sh
t7103-reset-bare.sh
t7104-reset-hard.sh
t7105-reset-patch.sh
t7106-reset-unborn-branch.sh
t7110-reset-merge.sh
t7111-reset-table.sh
t7112-reset-submodule.sh
t7201-co.sh
t7300-clean.sh
t7301-clean-interactive.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
t7409-submodule-detached-worktree.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
t7510-signed-commit.sh
t7511-status-index.sh
t7512-status-help.sh
t7513-interpret-trailers.sh
t7514-commit-patch.sh
t7515-status-symlinks.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
t7612-merge-verify-signatures.sh
t7613-merge-submodule.sh
t7700-repack.sh
t7701-repack-unpack-unreachable.sh
t7702-repack-cyclic-alternate.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
t8008-blame-formats.sh
t9001-send-email.sh
t9002-column.sh
t9010-svn-fe.sh
t9011-svn-da.sh
t9020-remote-svn.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
t9147-git-svn-include-paths.sh
t9148-git-svn-propset.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
t9159-git-svn-no-parent-mergeinfo.sh
t9160-git-svn-preserve-empty-dirs.sh
t9161-git-svn-mergeinfo-push.sh
t9162-git-svn-dcommit-interactive.sh
t9163-git-svn-reset-clears-caches.sh
t9164-git-svn-dcommit-concurrent.sh
t9165-git-svn-fetch-merge-branch-of-branch.sh
t9166-git-svn-fetch-merge-branch-of-branch2.sh
t9167-git-svn-cmd-branch-subproject.sh
t9200-git-cvsexportcommit.sh
t9300-fast-import.sh
t9301-fast-import-notes.sh
t9350-fast-export.sh
t9351-fast-export-anonymize.sh
t9400-git-cvsserver-server.sh
t9401-git-cvsserver-crlf.sh
t9402-git-cvsserver-refs.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
t9604-cvsimport-timestamps.sh
t9700-perl-git.sh
t9800-git-p4-basic.sh
t9801-git-p4-branch.sh
t9802-git-p4-filetype.sh
t9803-git-p4-shell-metachars.sh
t9804-git-p4-label.sh
t9805-git-p4-skip-submit-edit.sh
t9806-git-p4-options.sh
t9807-git-p4-submit.sh
t9808-git-p4-chdir.sh
t9809-git-p4-client-view.sh
t9810-git-p4-rcs.sh
t9811-git-p4-label-import.sh
t9812-git-p4-wildcards.sh
t9813-git-p4-preserve-users.sh
t9814-git-p4-rename.sh
t9815-git-p4-submit-fail.sh
t9816-git-p4-locked.sh
t9901-git-web--browse.sh
t9902-completion.sh
t9903-bash-prompt.sh
test-binary-1.png
test-binary-2.png
test-lib-functions.sh
test-lib.sh
test-terminal.perl
templates
vcs-svn
xdiff
.gitattributes
.gitignore
.mailmap
COPYING
GIT-VERSION-GEN
INSTALL
LGPL-2.1
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
argv-array.c
argv-array.h
attr.c
attr.h
base85.c
bisect.c
bisect.h
blob.c
blob.h
branch.c
branch.h
builtin.h
bulk-checkin.c
bulk-checkin.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
column.c
column.h
combine-diff.c
command-list.txt
commit-slab.h
commit.c
commit.h
config.c
config.mak.in
config.mak.uname
configure.ac
connect.c
connect.h
connected.c
connected.h
convert.c
convert.h
copy.c
credential-cache--daemon.c
credential-cache.c
credential-store.c
credential.c
credential.h
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.c
fetch-pack.h
fmt-merge-msg.h
fsck.c
fsck.h
generate-cmdlist.sh
gettext.c
gettext.h
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-merge-octopus.sh
git-merge-one-file.sh
git-merge-resolve.sh
git-mergetool--lib.sh
git-mergetool.sh
git-p4.py
git-parse-remote.sh
git-pull.sh
git-quiltimport.sh
git-rebase--am.sh
git-rebase--interactive.sh
git-rebase--merge.sh
git-rebase.sh
git-relink.perl
git-remote-testgit.sh
git-request-pull.sh
git-send-email.perl
git-sh-i18n.sh
git-sh-setup.sh
git-stash.sh
git-submodule.sh
git-svn.perl
git-web--browse.sh
git.c
git.rc
git.spec.in
gpg-interface.c
gpg-interface.h
graph.c
graph.h
grep.c
grep.h
hashmap.c
hashmap.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
khash.h
kwset.c
kwset.h
levenshtein.c
levenshtein.h
line-log.c
line-log.h
line-range.c
line-range.h
list-objects.c
list-objects.h
ll-merge.c
ll-merge.h
lockfile.c
lockfile.h
log-tree.c
log-tree.h
mailmap.c
mailmap.h
match-trees.c
merge-blobs.c
merge-blobs.h
merge-recursive.c
merge-recursive.h
merge.c
mergesort.c
mergesort.h
name-hash.c
notes-cache.c
notes-cache.h
notes-merge.c
notes-merge.h
notes-utils.c
notes-utils.h
notes.c
notes.h
object.c
object.h
pack-bitmap-write.c
pack-bitmap.c
pack-bitmap.h
pack-check.c
pack-objects.c
pack-objects.h
pack-revindex.c
pack-revindex.h
pack-write.c
pack.h
pager.c
parse-options-cb.c
parse-options.c
parse-options.h
patch-delta.c
patch-ids.c
patch-ids.h
path.c
pathspec.c
pathspec.h
pkt-line.c
pkt-line.h
preload-index.c
pretty.c
prio-queue.c
prio-queue.h
progress.c
progress.h
prompt.c
prompt.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-testsvn.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.c
send-pack.h
sequencer.c
sequencer.h
server-info.c
setup.c
sh-i18n--envsubst.c
sha1-array.c
sha1-array.h
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
split-index.c
split-index.h
strbuf.c
strbuf.h
streaming.c
streaming.h
string-list.c
string-list.h
submodule.c
submodule.h
symlinks.c
tag.c
tag.h
tar.h
test-chmtime.c
test-config.c
test-ctype.c
test-date.c
test-delta.c
test-dump-cache-tree.c
test-dump-split-index.c
test-genrandom.c
test-hashmap.c
test-index-version.c
test-line-buffer.c
test-match-trees.c
test-mergesort.c
test-mktemp.c
test-parse-options.c
test-path-utils.c
test-prio-queue.c
test-read-cache.c
test-regex.c
test-revision-walking.c
test-run-command.c
test-scrap-cache-tree.c
test-sha1-array.c
test-sha1.c
test-sha1.sh
test-sigchain.c
test-string-list.c
test-subprocess.c
test-svn-fe.c
test-urlmatch-normalization.c
test-wildmatch.c
thread-utils.c
thread-utils.h
trace.c
trace.h
trailer.c
trailer.h
transport-helper.c
transport.c
transport.h
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
tree.h
unicode_width.h
unimplemented.sh
unix-socket.c
unix-socket.h
unpack-trees.c
unpack-trees.h
update_unicode.sh
upload-pack.c
url.c
url.h
urlmatch.c
urlmatch.h
usage.c
userdiff.c
userdiff.h
utf8.c
utf8.h
varint.c
varint.h
version.c
version.h
versioncmp.c
walker.c
walker.h
wildmatch.c
wildmatch.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
/
t5516-fetch-push.sh
Blame
Blame
Latest commit
History
History
executable file
·
1437 lines (1222 loc) · 37 KB
Breadcrumbs
git
/
t
/
t5516-fetch-push.sh
Top
File metadata and controls
Code
Blame
executable file
·
1437 lines (1222 loc) · 37 KB
Raw
#!/bin/sh test_description='Basic fetch/push functionality. This test checks the following functionality: * command-line syntax * refspecs * fast-forward detection, and overriding it * configuration * hooks * --porcelain output format * hiderefs * reflogs ' . ./test-lib.sh D=`pwd` mk_empty () { repo_name="$1" rm -fr "$repo_name" && mkdir "$repo_name" && ( cd "$repo_name" && git init && git config receive.denyCurrentBranch warn && mv .git/hooks .git/hooks-disabled ) } mk_test () { repo_name="$1" shift mk_empty "$repo_name" && ( for ref in "$@" do git push "$repo_name" $the_first_commit:refs/$ref || exit done && cd "$repo_name" && for ref in "$@" do echo "$the_first_commit" >expect && git show-ref -s --verify refs/$ref >actual && test_cmp expect actual || exit done && git fsck --full ) } mk_test_with_hooks() { repo_name=$1 mk_test "$@" && ( cd "$repo_name" && mkdir .git/hooks && cd .git/hooks && cat >pre-receive <<-'EOF' && #!/bin/sh cat - >>pre-receive.actual EOF cat >update <<-'EOF' && #!/bin/sh printf "%s %s %s\n" "$@" >>update.actual EOF cat >post-receive <<-'EOF' && #!/bin/sh cat - >>post-receive.actual EOF cat >post-update <<-'EOF' && #!/bin/sh for ref in "$@" do printf "%s\n" "$ref" >>post-update.actual done EOF chmod +x pre-receive update post-receive post-update ) } mk_child() { rm -rf "$2" && git clone "$1" "$2" } check_push_result () { repo_name="$1" shift ( cd "$repo_name" && echo "$1" >expect && shift && for ref in "$@" do git show-ref -s --verify refs/$ref >actual && test_cmp expect actual || exit done && git fsck --full ) } test_expect_success setup ' >path1 && git add path1 && test_tick && git commit -a -m repo && the_first_commit=$(git show-ref -s --verify refs/heads/master) && >path2 && git add path2 && test_tick && git commit -a -m second && the_commit=$(git show-ref -s --verify refs/heads/master) ' test_expect_success 'fetch without wildcard' ' mk_empty testrepo && ( cd testrepo && git fetch .. refs/heads/master:refs/remotes/origin/master && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'fetch with wildcard' ' mk_empty testrepo && ( cd testrepo && git config remote.up.url .. && git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" && git fetch up && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'fetch with insteadOf' ' mk_empty testrepo && ( TRASH=$(pwd)/ && cd testrepo && git config "url.$TRASH.insteadOf" trash/ && git config remote.up.url trash/. && git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" && git fetch up && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'fetch with pushInsteadOf (should not rewrite)' ' mk_empty testrepo && ( TRASH=$(pwd)/ && cd testrepo && git config "url.trash/.pushInsteadOf" "$TRASH" && git config remote.up.url "$TRASH." && git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" && git fetch up && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'push without wildcard' ' mk_empty testrepo && git push testrepo refs/heads/master:refs/remotes/origin/master && ( cd testrepo && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'push with wildcard' ' mk_empty testrepo && git push testrepo "refs/heads/*:refs/remotes/origin/*" && ( cd testrepo && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'push with insteadOf' ' mk_empty testrepo && TRASH="$(pwd)/" && test_config "url.$TRASH.insteadOf" trash/ && git push trash/testrepo refs/heads/master:refs/remotes/origin/master && ( cd testrepo && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'push with pushInsteadOf' ' mk_empty testrepo && TRASH="$(pwd)/" && test_config "url.$TRASH.pushInsteadOf" trash/ && git push trash/testrepo refs/heads/master:refs/remotes/origin/master && ( cd testrepo && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf should not rewrite)' ' mk_empty testrepo && test_config "url.trash2/.pushInsteadOf" testrepo/ && test_config "url.trash3/.pushInsteadOf" trash/wrong && test_config remote.r.url trash/wrong && test_config remote.r.pushurl "testrepo/" && git push r refs/heads/master:refs/remotes/origin/master && ( cd testrepo && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) ' test_expect_success 'push with matching heads' ' mk_test testrepo heads/master && git push testrepo : && check_push_result testrepo $the_commit heads/master ' test_expect_success 'push with matching heads on the command line' ' mk_test testrepo heads/master && git push testrepo : && check_push_result testrepo $the_commit heads/master ' test_expect_success 'failed (non-fast-forward) push with matching heads' ' mk_test testrepo heads/master && git push testrepo : && git commit --amend -massaged && test_must_fail git push testrepo && check_push_result testrepo $the_commit heads/master && git reset --hard $the_commit ' test_expect_success 'push --force with matching heads' ' mk_test testrepo heads/master && git push testrepo : && git commit --amend -massaged && git push --force testrepo : && ! check_push_result testrepo $the_commit heads/master && git reset --hard $the_commit ' test_expect_success 'push with matching heads and forced update' ' mk_test testrepo heads/master && git push testrepo : && git commit --amend -massaged && git push testrepo +: && ! check_push_result testrepo $the_commit heads/master && git reset --hard $the_commit ' test_expect_success 'push with no ambiguity (1)' ' mk_test testrepo heads/master && git push testrepo master:master && check_push_result testrepo $the_commit heads/master ' test_expect_success 'push with no ambiguity (2)' ' mk_test testrepo remotes/origin/master && git push testrepo master:origin/master && check_push_result testrepo $the_commit remotes/origin/master ' test_expect_success 'push with colon-less refspec, no ambiguity' ' mk_test testrepo heads/master heads/t/master && git branch -f t/master master && git push testrepo master && check_push_result testrepo $the_commit heads/master && check_push_result testrepo $the_first_commit heads/t/master ' test_expect_success 'push with weak ambiguity (1)' ' mk_test testrepo heads/master remotes/origin/master && git push testrepo master:master && check_push_result testrepo $the_commit heads/master && check_push_result testrepo $the_first_commit remotes/origin/master ' test_expect_success 'push with weak ambiguity (2)' ' mk_test testrepo heads/master remotes/origin/master remotes/another/master && git push testrepo master:master && check_push_result testrepo $the_commit heads/master && check_push_result testrepo $the_first_commit remotes/origin/master remotes/another/master ' test_expect_success 'push with ambiguity' ' mk_test testrepo heads/frotz tags/frotz && test_must_fail git push testrepo master:frotz && check_push_result testrepo $the_first_commit heads/frotz tags/frotz ' test_expect_success 'push with colon-less refspec (1)' ' mk_test testrepo heads/frotz tags/frotz && git branch -f frotz master && git push testrepo frotz && check_push_result testrepo $the_commit heads/frotz && check_push_result testrepo $the_first_commit tags/frotz ' test_expect_success 'push with colon-less refspec (2)' ' mk_test testrepo heads/frotz tags/frotz && if git show-ref --verify -q refs/heads/frotz then git branch -D frotz fi && git tag -f frotz && git push -f testrepo frotz && check_push_result testrepo $the_commit tags/frotz && check_push_result testrepo $the_first_commit heads/frotz ' test_expect_success 'push with colon-less refspec (3)' ' mk_test testrepo && if git show-ref --verify -q refs/tags/frotz then git tag -d frotz fi && git branch -f frotz master && git push testrepo frotz && check_push_result testrepo $the_commit heads/frotz && test 1 = $( cd testrepo && git show-ref | wc -l ) ' test_expect_success 'push with colon-less refspec (4)' ' mk_test testrepo && if git show-ref --verify -q refs/heads/frotz then git branch -D frotz fi && git tag -f frotz && git push testrepo frotz && check_push_result testrepo $the_commit tags/frotz && test 1 = $( cd testrepo && git show-ref | wc -l ) ' test_expect_success 'push head with non-existent, incomplete dest' ' mk_test testrepo && git push testrepo master:branch && check_push_result testrepo $the_commit heads/branch ' test_expect_success 'push tag with non-existent, incomplete dest' ' mk_test testrepo && git tag -f v1.0 && git push testrepo v1.0:tag && check_push_result testrepo $the_commit tags/tag ' test_expect_success 'push sha1 with non-existent, incomplete dest' ' mk_test testrepo && test_must_fail git push testrepo `git rev-parse master`:foo ' test_expect_success 'push ref expression with non-existent, incomplete dest' ' mk_test testrepo && test_must_fail git push testrepo master^:branch ' test_expect_success 'push with HEAD' ' mk_test testrepo heads/master && git checkout master && git push testrepo HEAD && check_push_result testrepo $the_commit heads/master ' test_expect_success 'push with HEAD nonexisting at remote' ' mk_test testrepo heads/master && git checkout -b local master && git push testrepo HEAD && check_push_result testrepo $the_commit heads/local ' test_expect_success 'push with +HEAD' ' mk_test testrepo heads/master && git checkout master && git branch -D local && git checkout -b local && git push testrepo master local && check_push_result testrepo $the_commit heads/master && check_push_result testrepo $the_commit heads/local && # Without force rewinding should fail git reset --hard HEAD^ && test_must_fail git push testrepo HEAD && check_push_result testrepo $the_commit heads/local && # With force rewinding should succeed git push testrepo +HEAD && check_push_result testrepo $the_first_commit heads/local ' test_expect_success 'push HEAD with non-existent, incomplete dest' ' mk_test testrepo && git checkout master && git push testrepo HEAD:branch && check_push_result testrepo $the_commit heads/branch ' test_expect_success 'push with config remote.*.push = HEAD' ' mk_test testrepo heads/local && git checkout master && git branch -f local $the_commit && ( cd testrepo && git checkout local && git reset --hard $the_first_commit ) && test_config remote.there.url testrepo && test_config remote.there.push HEAD && test_config branch.master.remote there && git push && check_push_result testrepo $the_commit heads/master && check_push_result testrepo $the_first_commit heads/local ' test_expect_success 'push with remote.pushdefault' ' mk_test up_repo heads/master && mk_test down_repo heads/master && test_config remote.up.url up_repo && test_config remote.down.url down_repo && test_config branch.master.remote up && test_config remote.pushdefault down && test_config push.default matching && git push && check_push_result up_repo $the_first_commit heads/master && check_push_result down_repo $the_commit heads/master ' test_expect_success 'push with config remote.*.pushurl' ' mk_test testrepo heads/master && git checkout master && test_config remote.there.url test2repo && test_config remote.there.pushurl testrepo && git push there : && check_push_result testrepo $the_commit heads/master ' test_expect_success 'push with config branch.*.pushremote' ' mk_test up_repo heads/master && mk_test side_repo heads/master && mk_test down_repo heads/master && test_config remote.up.url up_repo && test_config remote.pushdefault side_repo && test_config remote.down.url down_repo && test_config branch.master.remote up && test_config branch.master.pushremote down && test_config push.default matching && git push && check_push_result up_repo $the_first_commit heads/master && check_push_result side_repo $the_first_commit heads/master && check_push_result down_repo $the_commit heads/master ' test_expect_success 'branch.*.pushremote config order is irrelevant' ' mk_test one_repo heads/master && mk_test two_repo heads/master && test_config remote.one.url one_repo && test_config remote.two.url two_repo && test_config branch.master.pushremote two_repo && test_config remote.pushdefault one_repo && test_config push.default matching && git push && check_push_result one_repo $the_first_commit heads/master && check_push_result two_repo $the_commit heads/master ' test_expect_success 'push with dry-run' ' mk_test testrepo heads/master && ( cd testrepo && old_commit=$(git show-ref -s --verify refs/heads/master) ) && git push --dry-run testrepo : && check_push_result testrepo $old_commit heads/master ' test_expect_success 'push updates local refs' ' mk_test testrepo heads/master && mk_child testrepo child && ( cd child && git pull .. master && git push && test $(git rev-parse master) = \ $(git rev-parse remotes/origin/master) ) ' test_expect_success 'push updates up-to-date local refs' ' mk_test testrepo heads/master && mk_child testrepo child1 && mk_child testrepo child2 && (cd child1 && git pull .. master && git push) && ( cd child2 && git pull ../child1 master && git push && test $(git rev-parse master) = \ $(git rev-parse remotes/origin/master) ) ' test_expect_success 'push preserves up-to-date packed refs' ' mk_test testrepo heads/master && mk_child testrepo child && ( cd child && git push && ! test -f .git/refs/remotes/origin/master ) ' test_expect_success 'push does not update local refs on failure' ' mk_test testrepo heads/master && mk_child testrepo child && mkdir testrepo/.git/hooks && echo "#!/no/frobnication/today" >testrepo/.git/hooks/pre-receive && chmod +x testrepo/.git/hooks/pre-receive && ( cd child && git pull .. master test_must_fail git push && test $(git rev-parse master) != \ $(git rev-parse remotes/origin/master) ) ' test_expect_success 'allow deleting an invalid remote ref' ' mk_test testrepo heads/master && rm -f testrepo/.git/objects/??/* && git push testrepo :refs/heads/master && (cd testrepo && test_must_fail git rev-parse --verify refs/heads/master) ' test_expect_success 'pushing valid refs triggers post-receive and post-update hooks' ' mk_test_with_hooks testrepo heads/master heads/next && orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) && newmaster=$(git show-ref -s --verify refs/heads/master) && orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) && newnext=$_z40 && git push testrepo refs/heads/master:refs/heads/master :refs/heads/next && ( cd testrepo/.git && cat >pre-receive.expect <<-EOF && $orgmaster $newmaster refs/heads/master $orgnext $newnext refs/heads/next EOF cat >update.expect <<-EOF && refs/heads/master $orgmaster $newmaster refs/heads/next $orgnext $newnext EOF cat >post-receive.expect <<-EOF && $orgmaster $newmaster refs/heads/master $orgnext $newnext refs/heads/next EOF cat >post-update.expect <<-EOF && refs/heads/master refs/heads/next EOF test_cmp pre-receive.expect pre-receive.actual && test_cmp update.expect update.actual && test_cmp post-receive.expect post-receive.actual && test_cmp post-update.expect post-update.actual ) ' test_expect_success 'deleting dangling ref triggers hooks with correct args' ' mk_test_with_hooks testrepo heads/master && rm -f testrepo/.git/objects/??/* && git push testrepo :refs/heads/master && ( cd testrepo/.git && cat >pre-receive.expect <<-EOF && $_z40 $_z40 refs/heads/master EOF cat >update.expect <<-EOF && refs/heads/master $_z40 $_z40 EOF cat >post-receive.expect <<-EOF && $_z40 $_z40 refs/heads/master EOF cat >post-update.expect <<-EOF && refs/heads/master EOF test_cmp pre-receive.expect pre-receive.actual && test_cmp update.expect update.actual && test_cmp post-receive.expect post-receive.actual && test_cmp post-update.expect post-update.actual ) ' test_expect_success 'deletion of a non-existent ref is not fed to post-receive and post-update hooks' ' mk_test_with_hooks testrepo heads/master && orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) && newmaster=$(git show-ref -s --verify refs/heads/master) && git push testrepo master :refs/heads/nonexistent && ( cd testrepo/.git && cat >pre-receive.expect <<-EOF && $orgmaster $newmaster refs/heads/master $_z40 $_z40 refs/heads/nonexistent EOF cat >update.expect <<-EOF && refs/heads/master $orgmaster $newmaster refs/heads/nonexistent $_z40 $_z40 EOF cat >post-receive.expect <<-EOF && $orgmaster $newmaster refs/heads/master EOF cat >post-update.expect <<-EOF && refs/heads/master EOF test_cmp pre-receive.expect pre-receive.actual && test_cmp update.expect update.actual && test_cmp post-receive.expect post-receive.actual && test_cmp post-update.expect post-update.actual ) ' test_expect_success 'deletion of a non-existent ref alone does trigger post-receive and post-update hooks' ' mk_test_with_hooks testrepo heads/master && git push testrepo :refs/heads/nonexistent && ( cd testrepo/.git && cat >pre-receive.expect <<-EOF && $_z40 $_z40 refs/heads/nonexistent EOF cat >update.expect <<-EOF && refs/heads/nonexistent $_z40 $_z40 EOF test_cmp pre-receive.expect pre-receive.actual && test_cmp update.expect update.actual && test_path_is_missing post-receive.actual && test_path_is_missing post-update.actual ) ' test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks with correct input' ' mk_test_with_hooks testrepo heads/master heads/next heads/pu && orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) && newmaster=$(git show-ref -s --verify refs/heads/master) && orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) && newnext=$_z40 && orgpu=$(cd testrepo && git show-ref -s --verify refs/heads/pu) && newpu=$(git show-ref -s --verify refs/heads/master) && git push testrepo refs/heads/master:refs/heads/master \ refs/heads/master:refs/heads/pu :refs/heads/next \ :refs/heads/nonexistent && ( cd testrepo/.git && cat >pre-receive.expect <<-EOF && $orgmaster $newmaster refs/heads/master $orgnext $newnext refs/heads/next $orgpu $newpu refs/heads/pu $_z40 $_z40 refs/heads/nonexistent EOF cat >update.expect <<-EOF && refs/heads/master $orgmaster $newmaster refs/heads/next $orgnext $newnext refs/heads/pu $orgpu $newpu refs/heads/nonexistent $_z40 $_z40 EOF cat >post-receive.expect <<-EOF && $orgmaster $newmaster refs/heads/master $orgnext $newnext refs/heads/next $orgpu $newpu refs/heads/pu EOF cat >post-update.expect <<-EOF && refs/heads/master refs/heads/next refs/heads/pu EOF test_cmp pre-receive.expect pre-receive.actual && test_cmp update.expect update.actual && test_cmp post-receive.expect post-receive.actual && test_cmp post-update.expect post-update.actual ) ' test_expect_success 'allow deleting a ref using --delete' ' mk_test testrepo heads/master && (cd testrepo && git config receive.denyDeleteCurrent warn) && git push testrepo --delete master && (cd testrepo && test_must_fail git rev-parse --verify refs/heads/master) ' test_expect_success 'allow deleting a tag using --delete' ' mk_test testrepo heads/master && git tag -a -m dummy_message deltag heads/master && git push testrepo --tags && (cd testrepo && git rev-parse --verify -q refs/tags/deltag) && git push testrepo --delete tag deltag && (cd testrepo && test_must_fail git rev-parse --verify refs/tags/deltag) ' test_expect_success 'push --delete without args aborts' ' mk_test testrepo heads/master && test_must_fail git push testrepo --delete ' test_expect_success 'push --delete refuses src:dest refspecs' ' mk_test testrepo heads/master && test_must_fail git push testrepo --delete master:foo ' test_expect_success 'warn on push to HEAD of non-bare repository' ' mk_test testrepo heads/master && ( cd testrepo && git checkout master && git config receive.denyCurrentBranch warn ) && git push testrepo master 2>stderr && grep "warning: updating the current branch" stderr ' test_expect_success 'deny push to HEAD of non-bare repository' ' mk_test testrepo heads/master && ( cd testrepo && git checkout master && git config receive.denyCurrentBranch true ) && test_must_fail git push testrepo master ' test_expect_success 'allow push to HEAD of bare repository (bare)' ' mk_test testrepo heads/master && ( cd testrepo && git checkout master && git config receive.denyCurrentBranch true && git config core.bare true ) && git push testrepo master 2>stderr && ! grep "warning: updating the current branch" stderr ' test_expect_success 'allow push to HEAD of non-bare repository (config)' ' mk_test testrepo heads/master && ( cd testrepo && git checkout master && git config receive.denyCurrentBranch false ) && git push testrepo master 2>stderr && ! grep "warning: updating the current branch" stderr ' test_expect_success 'fetch with branches' ' mk_empty testrepo && git branch second $the_first_commit && git checkout second && echo ".." > testrepo/.git/branches/branch1 && ( cd testrepo && git fetch branch1 && echo "$the_commit commit refs/heads/branch1" >expect && git for-each-ref refs/heads >actual && test_cmp expect actual ) && git checkout master ' test_expect_success 'fetch with branches containing #' ' mk_empty testrepo && echo "..#second" > testrepo/.git/branches/branch2 && ( cd testrepo && git fetch branch2 && echo "$the_first_commit commit refs/heads/branch2" >expect && git for-each-ref refs/heads >actual && test_cmp expect actual ) && git checkout master ' test_expect_success 'push with branches' ' mk_empty testrepo && git checkout second && echo "testrepo" > .git/branches/branch1 && git push branch1 && ( cd testrepo && echo "$the_first_commit commit refs/heads/master" >expect && git for-each-ref refs/heads >actual && test_cmp expect actual ) ' test_expect_success 'push with branches containing #' ' mk_empty testrepo && echo "testrepo#branch3" > .git/branches/branch2 && git push branch2 && ( cd testrepo && echo "$the_first_commit commit refs/heads/branch3" >expect && git for-each-ref refs/heads >actual && test_cmp expect actual ) && git checkout master ' test_expect_success 'push into aliased refs (consistent)' ' mk_test testrepo heads/master && mk_child testrepo child1 && mk_child testrepo child2 && ( cd child1 && git branch foo && git symbolic-ref refs/heads/bar refs/heads/foo git config receive.denyCurrentBranch false ) && ( cd child2 && >path2 && git add path2 && test_tick && git commit -a -m child2 && git branch foo && git branch bar && git push ../child1 foo bar ) ' test_expect_success 'push into aliased refs (inconsistent)' ' mk_test testrepo heads/master && mk_child testrepo child1 && mk_child testrepo child2 && ( cd child1 && git branch foo && git symbolic-ref refs/heads/bar refs/heads/foo git config receive.denyCurrentBranch false ) && ( cd child2 && >path2 && git add path2 && test_tick && git commit -a -m child2 && git branch foo && >path3 && git add path3 && test_tick && git commit -a -m child2 && git branch bar && test_must_fail git push ../child1 foo bar 2>stderr && grep "refusing inconsistent update" stderr ) ' test_expect_success 'push requires --force to update lightweight tag' ' mk_test testrepo heads/master && mk_child testrepo child1 && mk_child testrepo child2 && ( cd child1 && git tag Tag && git push ../child2 Tag && git push ../child2 Tag && >file1 && git add file1 && git commit -m "file1" && git tag -f Tag && test_must_fail git push ../child2 Tag && git push --force ../child2 Tag && git tag -f Tag && test_must_fail git push ../child2 Tag HEAD~ && git push --force ../child2 Tag ) ' test_expect_success 'push --porcelain' ' mk_empty testrepo && echo >.git/foo "To testrepo" && echo >>.git/foo "* refs/heads/master:refs/remotes/origin/master [new branch]" && echo >>.git/foo "Done" && git push >.git/bar --porcelain testrepo refs/heads/master:refs/remotes/origin/master && ( cd testrepo && echo "$the_commit commit refs/remotes/origin/master" >expect && git for-each-ref refs/remotes/origin >actual && test_cmp expect actual ) && test_cmp .git/foo .git/bar ' test_expect_success 'push --porcelain bad url' ' mk_empty testrepo && test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master && test_must_fail grep -q Done .git/bar ' test_expect_success 'push --porcelain rejected' ' mk_empty testrepo && git push testrepo refs/heads/master:refs/remotes/origin/master && (cd testrepo && git reset --hard origin/master^ git config receive.denyCurrentBranch true) && echo >.git/foo "To testrepo" && echo >>.git/foo "! refs/heads/master:refs/heads/master [remote rejected] (branch is currently checked out)" && test_must_fail git push >.git/bar --porcelain testrepo refs/heads/master:refs/heads/master && test_cmp .git/foo .git/bar ' test_expect_success 'push --porcelain --dry-run rejected' ' mk_empty testrepo && git push testrepo refs/heads/master:refs/remotes/origin/master && (cd testrepo && git reset --hard origin/master git config receive.denyCurrentBranch true) && echo >.git/foo "To testrepo" && echo >>.git/foo "! refs/heads/master^:refs/heads/master [rejected] (non-fast-forward)" && echo >>.git/foo "Done" && test_must_fail git push >.git/bar --porcelain --dry-run testrepo refs/heads/master^:refs/heads/master && test_cmp .git/foo .git/bar ' test_expect_success 'push --prune' ' mk_test testrepo heads/master heads/second heads/foo heads/bar && git push --prune testrepo : && check_push_result testrepo $the_commit heads/master && check_push_result testrepo $the_first_commit heads/second && ! check_push_result testrepo $the_first_commit heads/foo heads/bar ' test_expect_success 'push --prune refspec' ' mk_test testrepo tmp/master tmp/second tmp/foo tmp/bar && git push --prune testrepo "refs/heads/*:refs/tmp/*" && check_push_result testrepo $the_commit tmp/master && check_push_result testrepo $the_first_commit tmp/second && ! check_push_result testrepo $the_first_commit tmp/foo tmp/bar ' for configsection in transfer receive do test_expect_success "push to update a ref hidden by $configsection.hiderefs" ' mk_test testrepo heads/master hidden/one hidden/two hidden/three && ( cd testrepo && git config $configsection.hiderefs refs/hidden ) && # push to unhidden ref succeeds normally git push testrepo master:refs/heads/master && check_push_result testrepo $the_commit heads/master && # push to update a hidden ref should fail test_must_fail git push testrepo master:refs/hidden/one && check_push_result testrepo $the_first_commit hidden/one && # push to delete a hidden ref should fail test_must_fail git push testrepo :refs/hidden/two && check_push_result testrepo $the_first_commit hidden/two && # idempotent push to update a hidden ref should fail test_must_fail git push testrepo $the_first_commit:refs/hidden/three && check_push_result testrepo $the_first_commit hidden/three ' done test_expect_success 'fetch exact SHA1' ' mk_test testrepo heads/master hidden/one && git push testrepo master:refs/hidden/one && ( cd testrepo && git config transfer.hiderefs refs/hidden ) && check_push_result testrepo $the_commit hidden/one && mk_child testrepo child && ( cd child && # make sure $the_commit does not exist here git repack -a -d && git prune && test_must_fail git cat-file -t $the_commit && # fetching the hidden object should fail by default test_must_fail git fetch -v ../testrepo $the_commit:refs/heads/copy && test_must_fail git rev-parse --verify refs/heads/copy && # the server side can allow it to succeed ( cd ../testrepo && git config uploadpack.allowtipsha1inwant true ) && git fetch -v ../testrepo $the_commit:refs/heads/copy && result=$(git rev-parse --verify refs/heads/copy) && test "$the_commit" = "$result" ) ' test_expect_success 'fetch follows tags by default' ' mk_test testrepo heads/master && rm -fr src dst && git init src && ( cd src && git pull ../testrepo master && git tag -m "annotated" tag && git for-each-ref >tmp1 && ( cat tmp1 sed -n "s|refs/heads/master$|refs/remotes/origin/master|p" tmp1 ) | sort -k 3 >../expect ) && git init dst && ( cd dst && git remote add origin ../src && git config branch.master.remote origin && git config branch.master.merge refs/heads/master && git pull && git for-each-ref >../actual ) && test_cmp expect actual ' test_expect_success 'pushing a specific ref applies remote.$name.push as refmap' ' mk_test testrepo heads/master && rm -fr src dst && git init src && git init --bare dst && ( cd src && git pull ../testrepo master && git branch next && git config remote.dst.url ../dst && git config remote.dst.push "+refs/heads/*:refs/remotes/src/*" && git push dst master && git show-ref refs/heads/master | sed -e "s|refs/heads/|refs/remotes/src/|" >../dst/expect ) && ( cd dst && test_must_fail git show-ref refs/heads/next && test_must_fail git show-ref refs/heads/master && git show-ref refs/remotes/src/master >actual ) && test_cmp dst/expect dst/actual ' test_expect_success 'with no remote.$name.push, it is not used as refmap' ' mk_test testrepo heads/master && rm -fr src dst && git init src && git init --bare dst && ( cd src && git pull ../testrepo master && git branch next && git config remote.dst.url ../dst && git config push.default matching && git push dst master && git show-ref refs/heads/master >../dst/expect ) && ( cd dst && test_must_fail git show-ref refs/heads/next && git show-ref refs/heads/master >actual ) && test_cmp dst/expect dst/actual ' test_expect_success 'with no remote.$name.push, upstream mapping is used' ' mk_test testrepo heads/master && rm -fr src dst && git init src && git init --bare dst && ( cd src && git pull ../testrepo master && git branch next && git config remote.dst.url ../dst && git config remote.dst.fetch "+refs/heads/*:refs/remotes/dst/*" && git config push.default upstream && git config branch.master.merge refs/heads/trunk && git config branch.master.remote dst && git push dst master && git show-ref refs/heads/master | sed -e "s|refs/heads/master|refs/heads/trunk|" >../dst/expect ) && ( cd dst && test_must_fail git show-ref refs/heads/master && test_must_fail git show-ref refs/heads/next && git show-ref refs/heads/trunk >actual ) && test_cmp dst/expect dst/actual ' test_expect_success 'push does not follow tags by default' ' mk_test testrepo heads/master && rm -fr src dst && git init src && git init --bare dst && ( cd src && git pull ../testrepo master && git tag -m "annotated" tag && git checkout -b another && git commit --allow-empty -m "future commit" && git tag -m "future" future && git checkout master && git for-each-ref refs/heads/master >../expect && git push ../dst master ) && ( cd dst && git for-each-ref >../actual ) && test_cmp expect actual ' test_expect_success 'push --follow-tag only pushes relevant tags' ' mk_test testrepo heads/master && rm -fr src dst && git init src && git init --bare dst && ( cd src && git pull ../testrepo master && git tag -m "annotated" tag && git checkout -b another && git commit --allow-empty -m "future commit" && git tag -m "future" future && git checkout master && git for-each-ref refs/heads/master refs/tags/tag >../expect git push --follow-tag ../dst master ) && ( cd dst && git for-each-ref >../actual ) && test_cmp expect actual ' test_expect_success 'push --no-thin must produce non-thin pack' ' cat >>path1 <<\EOF && keep base version of path1 big enough, compared to the new changes later, in order to pass size heuristics in builtin/pack-objects.c:try_delta() EOF git commit -am initial && git init no-thin && git --git-dir=no-thin/.git config receive.unpacklimit 0 && git push no-thin/.git refs/heads/master:refs/heads/foo && echo modified >> path1 && git commit -am modified && git repack -adf && rcvpck="git receive-pack --reject-thin-pack-for-testing" && git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/master:refs/heads/foo ' test_expect_success 'pushing a tag pushes the tagged object' ' rm -rf dst.git && blob=$(echo unreferenced | git hash-object -w --stdin) && git tag -m foo tag-of-blob $blob && git init --bare dst.git && git push dst.git tag-of-blob && # the receiving index-pack should have noticed # any problems, but we double check echo unreferenced >expect && git --git-dir=dst.git cat-file blob tag-of-blob >actual && test_cmp expect actual ' test_expect_success 'push into bare respects core.logallrefupdates' ' rm -rf dst.git && git init --bare dst.git && git -C dst.git config core.logallrefupdates true && # double push to test both with and without # the actual pack transfer git push dst.git master:one && echo "one@{0} push" >expect && git -C dst.git log -g --format="%gd %gs" one >actual && test_cmp expect actual && git push dst.git master:two && echo "two@{0} push" >expect && git -C dst.git log -g --format="%gd %gs" two >actual && test_cmp expect actual ' test_expect_success 'fetch into bare respects core.logallrefupdates' ' rm -rf dst.git && git init --bare dst.git && ( cd dst.git && git config core.logallrefupdates true && # as above, we double-fetch to test both # with and without pack transfer git fetch .. master:one && echo "one@{0} fetch .. master:one: storing head" >expect && git log -g --format="%gd %gs" one >actual && test_cmp expect actual && git fetch .. master:two && echo "two@{0} fetch .. master:two: storing head" >expect && git log -g --format="%gd %gs" two >actual && test_cmp expect actual ) ' test_expect_success 'receive.denyCurrentBranch = updateInstead' ' git push testrepo master && ( cd testrepo && git reset --hard && git config receive.denyCurrentBranch updateInstead ) && test_commit third path2 && # Try pushing into a repository with pristine working tree git push testrepo master && ( cd testrepo && git update-index -q --refresh && git diff-files --quiet -- && git diff-index --quiet --cached HEAD -- && test third = "$(cat path2)" && test $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD) ) && # Try pushing into a repository with working tree needing a refresh ( cd testrepo && git reset --hard HEAD^ && test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) && test-chmtime +100 path1 ) && git push testrepo master && ( cd testrepo && git update-index -q --refresh && git diff-files --quiet -- && git diff-index --quiet --cached HEAD -- && test_cmp ../path1 path1 && test third = "$(cat path2)" && test $(git -C .. rev-parse HEAD) = $(git rev-parse HEAD) ) && # Update what is to be pushed test_commit fourth path2 && # Try pushing into a repository with a dirty working tree # (1) the working tree updated ( cd testrepo && echo changed >path1 ) && test_must_fail git push testrepo master && ( cd testrepo && test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) && git diff --quiet --cached && test changed = "$(cat path1)" ) && # (2) the index updated ( cd testrepo && echo changed >path1 && git add path1 ) && test_must_fail git push testrepo master && ( cd testrepo && test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) && git diff --quiet && test changed = "$(cat path1)" ) && # Introduce a new file in the update test_commit fifth path3 && # (3) the working tree has an untracked file that would interfere ( cd testrepo && git reset --hard && echo changed >path3 ) && test_must_fail git push testrepo master && ( cd testrepo && test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) && git diff --quiet && git diff --quiet --cached && test changed = "$(cat path3)" ) && # (4) the target changes to what gets pushed but it still is a change ( cd testrepo && git reset --hard && echo fifth >path3 && git add path3 ) && test_must_fail git push testrepo master && ( cd testrepo && test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) && git diff --quiet && test fifth = "$(cat path3)" ) ' 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
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
You can’t perform that action at this time.