git-commit-vandalism/builtin
Pang Yan Han 160b81ed81 receive-pack: don't pass non-existent refs to post-{receive,update} hooks
When a push specifies deletion of non-existent refs, the post post-receive and
post-update hooks receive them as input/arguments.

For instance, for the following push, where refs/heads/nonexistent is a ref
which does not exist on the remote side:

	git push origin :refs/heads/nonexistent

the post-receive hook receives from standard input:

	<null-sha1> SP <null-sha1> SP refs/heads/nonexistent

and the post-update hook receives as arguments:

	refs/heads/nonexistent

which does not make sense since it is a no-op.

Teach receive-pack not to pass non-existent refs to the post-receive and
post-update hooks. If the push only attempts to delete non-existent refs,
these hooks are not even called.

The update and pre-receive hooks are still notified about attempted
deletion of non-existent refs to give them a chance to inspect the
situation and act on it.

[jc: mild fix-ups to avoid introducing an extra list; also added fixes to
some tests]

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-30 12:18:46 -07:00
..
add.c
annotate.c
apply.c zlib: zlib can only process 4GB at a time 2011-06-10 11:52:15 -07:00
archive.c upload-archive: allow user to turn off filters 2011-06-22 11:12:35 -07:00
bisect--helper.c bisect: introduce support for --no-checkout option. 2011-08-04 15:34:32 -07:00
blame.c
branch.c Merge branch 'ci/forbid-unwanted-current-branch-update' 2011-09-16 21:48:10 -07:00
bundle.c
cat-file.c plug a few coverity-spotted leaks 2011-06-20 14:27:36 -07:00
check-attr.c git-check-attr: Normalize paths 2011-08-04 15:57:18 -07:00
check-ref-format.c check-ref-format --print: Normalize refnames that start with slashes 2011-08-25 13:39:38 -07:00
checkout-index.c checkout-index: remove obsolete comment 2011-08-17 10:39:47 -07:00
checkout.c Merge branch 'ci/forbid-unwanted-current-branch-update' 2011-09-16 21:48:10 -07:00
clean.c Documentation: clarify "git clean -e <pattern>" 2011-08-28 23:47:55 -07:00
clone.c Merge branch 'nd/maint-clone-gitdir' 2011-08-28 21:20:28 -07:00
commit-tree.c Sync with 1.7.3.2 2010-10-21 17:16:10 -07:00
commit.c Merge branch 'jk/color-and-pager' 2011-08-28 21:19:16 -07:00
config.c config: refactor get_colorbool function 2011-08-19 15:51:37 -07:00
count-objects.c
describe.c describe: Refresh the index when run with --dirty 2011-08-11 13:03:35 -07:00
diff-files.c
diff-index.c
diff-tree.c
diff.c want_color: automatically fallback to color.ui 2011-08-19 15:51:38 -07:00
fast-export.c Merge branch 'jk/fast-export-quote-path' 2011-08-11 11:03:16 -07:00
fetch-pack.c Merge branch 'nd/decorate-grafts' 2011-08-28 21:22:58 -07:00
fetch.c fetch: skip on-demand checking when no submodules are configured 2011-09-09 13:59:20 -07:00
fmt-merge-msg.c
for-each-ref.c
fsck.c
gc.c builtin/gc.c: add missing newline in message 2011-06-19 14:46:39 -07:00
grep.c Merge branch 'jk/color-and-pager' 2011-08-28 21:19:16 -07:00
hash-object.c
help.c
index-pack.c Merge branch 'jc/zlib-wrap' into maint 2011-08-16 11:23:26 -07:00
init-db.c read_gitfile_gently(): rename misnamed function to read_gitfile() 2011-08-22 14:04:56 -07:00
log.c format-patch: ignore ui.color 2011-09-12 11:43:58 -07:00
ls-files.c Merge branch 'cb/maint-ls-files-error-report' 2011-08-23 15:34:31 -07:00
ls-remote.c
ls-tree.c Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails. 2011-07-25 10:50:11 -07:00
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'jk/color-and-pager' 2011-08-28 21:19:16 -07:00
mktag.c
mktree.c
mv.c
name-rev.c
notes.c
pack-objects.c Merge branch 'mh/check-attr-relative' 2011-08-17 17:36:22 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
push.c push: Don't push a repository with unpushed submodules 2011-08-20 23:03:52 -07:00
read-tree.c
receive-pack.c receive-pack: don't pass non-existent refs to post-{receive,update} hooks 2011-09-30 12:18:46 -07:00
reflog.c reflog: actually default to subcommand 'show' 2011-08-01 10:52:34 -07:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'maint' 2011-08-25 16:00:07 -07:00
replace.c
rerere.c
reset.c Merge branch 'jk/reset-reflog-message-fix' into maint 2011-09-11 22:33:20 -07:00
rev-list.c Merge branch 'jk/format-patch-am' 2011-05-31 12:19:11 -07:00
rev-parse.c
revert.c Merge branch 'jn/plug-empty-tree-leak' 2011-08-25 16:00:29 -07:00
rm.c
send-pack.c Revert "Merge branch 'cb/maint-quiet-push' into maint" 2011-09-06 11:10:41 -07:00
shortlog.c Merge branch 'jk/format-patch-am' 2011-05-31 12:19:11 -07:00
show-branch.c want_color: automatically fallback to color.ui 2011-08-19 15:51:38 -07:00
show-ref.c
stripspace.c
symbolic-ref.c
tag.c Merge branch 'jk/tag-contains-ab' (early part) into maint 2011-09-11 21:54:32 -07:00
tar-tree.c
unpack-file.c
unpack-objects.c zlib: zlib can only process 4GB at a time 2011-06-10 11:52:15 -07:00
update-index.c plug a few coverity-spotted leaks 2011-06-20 14:27:36 -07:00
update-ref.c update-ref: whitespace fix 2011-08-25 14:42:11 -07:00
update-server-info.c
upload-archive.c upload-archive: allow user to turn off filters 2011-06-22 11:12:35 -07:00
var.c
verify-pack.c verify-pack: use index-pack --verify 2011-06-05 22:45:38 -07:00
verify-tag.c
write-tree.c