git/builtin
Michael Haggerty a933c23e66 commit: avoid race when creating orphan commits
If HEAD doesn't point at anything during the initial check, then we
should make sure that it *still* doesn't point at anything when we are
ready to update the reference. Otherwise, another process might commit
while we are working (e.g., while we are waiting for the user to edit
the commit message) and we will silently overwrite it.

This fixes a failing test in t7516.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17 11:24:20 -08:00
..
add.c standardize usage info string format 2015-01-14 09:32:04 -08:00
annotate.c annotate: use argv_array 2014-07-16 11:10:11 -07:00
apply.c Merge branch 'ah/usage-strings' 2015-02-11 13:44:20 -08:00
archive.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
bisect--helper.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
blame.c Merge branch 'ah/usage-strings' 2015-02-11 13:44:20 -08:00
branch.c standardize usage info string format 2015-01-14 09:32:04 -08:00
bundle.c
cat-file.c Merge branch 'ah/usage-strings' 2015-02-11 13:44:20 -08:00
check-attr.c standardize usage info string format 2015-01-14 09:32:04 -08:00
check-ignore.c standardize usage info string format 2015-01-14 09:32:04 -08:00
check-mailmap.c standardize usage info string format 2015-01-14 09:32:04 -08:00
check-ref-format.c standardize usage info string format 2015-01-14 09:32:04 -08:00
checkout-index.c standardize usage info string format 2015-01-14 09:32:04 -08:00
checkout.c standardize usage info string format 2015-01-14 09:32:04 -08:00
clean.c clean: typofix 2014-12-22 09:57:42 -08:00
clone.c standardize usage info string format 2015-01-14 09:32:04 -08:00
column.c standardize usage info string format 2015-01-14 09:32:04 -08:00
commit-tree.c commit-tree: simplify parsing of option -S using skip_prefix() 2014-12-29 09:32:45 -08:00
commit.c commit: avoid race when creating orphan commits 2015-02-17 11:24:20 -08:00
config.c standardize usage info string format 2015-01-14 09:32:04 -08:00
count-objects.c count-objects: use for_each_loose_file_in_objdir 2014-10-16 10:10:41 -07:00
credential.c
describe.c standardize usage info string format 2015-01-14 09:32:04 -08:00
diff-files.c standardize usage info string format 2015-01-14 09:32:04 -08:00
diff-index.c standardize usage info string format 2015-01-14 09:32:04 -08:00
diff-tree.c standardize usage info string format 2015-01-14 09:32:04 -08:00
diff.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
fast-export.c teach fast-export an --anonymize option 2014-08-27 10:42:16 -07:00
fetch-pack.c standardize usage info string format 2015-01-14 09:32:04 -08:00
fetch.c ref_transaction_update(): remove "have_old" parameter 2015-02-17 11:22:50 -08:00
fmt-merge-msg.c standardize usage info string format 2015-01-14 09:32:04 -08:00
for-each-ref.c Merge branch 'ah/usage-strings' 2015-02-11 13:44:20 -08:00
fsck.c standardize usage info string format 2015-01-14 09:32:04 -08:00
gc.c standardize usage info string format 2015-01-14 09:32:04 -08:00
get-tar-commit-id.c use skip_prefix() to avoid more magic numbers 2014-10-07 11:09:16 -07:00
grep.c standardize usage info string format 2015-01-14 09:32:04 -08:00
hash-object.c standardize usage info string format 2015-01-14 09:32:04 -08:00
help.c standardize usage info string format 2015-01-14 09:32:04 -08:00
index-pack.c Merge branch 'js/fsck-tag-validation' 2014-12-22 12:27:41 -08:00
init-db.c standardize usage info string format 2015-01-14 09:32:04 -08:00
interpret-trailers.c trailer: add interpret-trailers command 2014-10-13 13:55:27 -07:00
log.c Merge branch 'ah/usage-strings' 2015-02-11 13:44:20 -08:00
ls-files.c standardize usage info string format 2015-01-14 09:32:04 -08:00
ls-remote.c standardize usage info string format 2015-01-14 09:32:04 -08:00
ls-tree.c ls-tree: disable negative pathspec because it's not supported 2014-12-01 11:33:45 -08:00
mailinfo.c standardize usage info string format 2015-01-14 09:32:04 -08:00
mailsplit.c mailsplit: remove unnecessary unlink(2) call 2014-10-07 10:49:57 -07:00
merge-base.c standardize usage info string format 2015-01-14 09:32:04 -08:00
merge-file.c standardize usage info string format 2015-01-14 09:32:04 -08:00
merge-index.c standardize usage info string format 2015-01-14 09:32:04 -08:00
merge-ours.c
merge-recursive.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
merge-tree.c merge-tree: remove unused df_conflict arguments 2014-09-02 11:02:58 -07:00
merge.c standardize usage info string format 2015-01-14 09:32:04 -08:00
mktag.c
mktree.c builtin/mktree.c: use ALLOC_GROW() in append_to_tree() 2014-03-03 14:54:45 -08:00
mv.c standardize usage info string format 2015-01-14 09:32:04 -08:00
name-rev.c standardize usage info string format 2015-01-14 09:32:04 -08:00
notes.c standardize usage info string format 2015-01-14 09:32:04 -08:00
pack-objects.c pack-objects: use --objects-edge-aggressive for shallow repos 2014-12-29 09:58:25 -08:00
pack-redundant.c standardize usage info string format 2015-01-14 09:32:04 -08:00
pack-refs.c standardize usage info string format 2015-01-14 09:32:04 -08:00
patch-id.c patch-id: make it stable against hunk reordering 2014-06-10 13:09:24 -07:00
prune-packed.c standardize usage info string format 2015-01-14 09:32:04 -08:00
prune.c prune: keep objects reachable from recent objects 2014-10-16 10:10:42 -07:00
push.c Merge branch 'sb/atomic-push' 2015-02-11 13:43:51 -08:00
read-tree.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
receive-pack.c ref_transaction_delete(): remove "have_old" parameter 2015-02-17 11:23:48 -08:00
reflog.c reflog_expire(): new function in the reference API 2014-12-22 10:11:40 -08:00
remote-ext.c use skip_prefix() to avoid more magic numbers 2014-10-07 11:09:16 -07:00
remote-fd.c
remote.c Merge branch 'ah/usage-strings' 2015-02-11 13:44:20 -08:00
repack.c standardize usage info string format 2015-01-14 09:32:04 -08:00
replace.c ref_transaction_update(): remove "have_old" parameter 2015-02-17 11:22:50 -08:00
rerere.c standardize usage info string format 2015-01-14 09:32:04 -08:00
reset.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
rev-list.c commit: record buffer length in cache 2014-06-13 12:09:38 -07:00
rev-parse.c standardize usage info string format 2015-01-14 09:32:04 -08:00
revert.c standardize usage info string format 2015-01-14 09:32:04 -08:00
rm.c standardize usage info string format 2015-01-14 09:32:04 -08:00
send-pack.c send-pack.c: add --atomic command line argument 2015-01-07 19:56:44 -08:00
shortlog.c standardize usage info string format 2015-01-14 09:32:04 -08:00
show-branch.c Merge branch 'ah/usage-strings' 2015-02-11 13:44:20 -08:00
show-ref.c standardize usage info string format 2015-01-14 09:32:04 -08:00
stripspace.c builtin/stripspace.c: fix broken indentation 2013-09-06 13:33:17 -07:00
symbolic-ref.c standardize usage info string format 2015-01-14 09:32:04 -08:00
tag.c ref_transaction_update(): remove "have_old" parameter 2015-02-17 11:22:50 -08:00
unpack-file.c
unpack-objects.c index-pack: terminate object buffers with NUL 2014-12-09 11:56:37 -08:00
update-index.c standardize usage info string format 2015-01-14 09:32:04 -08:00
update-ref.c ref_transaction_delete(): remove "have_old" parameter 2015-02-17 11:23:48 -08:00
update-server-info.c i18n: update-server-info: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00
upload-archive.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
var.c
verify-commit.c standardize usage info string format 2015-01-14 09:32:04 -08:00
verify-pack.c standardize usage info string format 2015-01-14 09:32:04 -08:00
verify-tag.c standardize usage info string format 2015-01-14 09:32:04 -08:00
write-tree.c i18n: write-tree: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00