summaryrefslogtreecommitdiff
path: root/compat/vcbuild/include/alloca.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@google.com>2014-05-06 22:45:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-05-08 21:31:44 (GMT)
commit482b8f3208e797f00db58edd7ff0d67275e898f5 (patch)
tree5d06db528220f8e9e4fc64cdb243a2103fc3cf23 /compat/vcbuild/include/alloca.h
parent4da588357a4a8b73f6a8d9c24435dabee74d0a7e (diff)
downloadgit-482b8f3208e797f00db58edd7ff0d67275e898f5.zip
git-482b8f3208e797f00db58edd7ff0d67275e898f5.tar.gz
git-482b8f3208e797f00db58edd7ff0d67275e898f5.tar.bz2
checkout.c: use ref_exists instead of file_exist
Change checkout.c to check if a ref exists instead of checking if a loose ref file exists when deciding if to delete an orphaned log file. Otherwise, if a ref only exists as a packed ref without a corresponding loose ref for the currently checked out branch, we risk that the reflog will be deleted when we switch to a different branch. Update the reflog tests to check for this bug. The following reproduces the bug: $ git init-db $ git config core.logallrefupdates true $ git commit -m Initial --allow-empty [master (root-commit) bb11abe] Initial $ git reflog master [8561dcb master@{0}: commit (initial): Initial] $ find .git/{refs,logs} -type f | grep master [.git/refs/heads/master] [.git/logs/refs/heads/master] $ git branch foo $ git pack-refs --all $ find .git/{refs,logs} -type f | grep master [.git/logs/refs/heads/master] $ git checkout foo $ find .git/{refs,logs} -type f | grep master ... reflog file is missing ... $ git reflog master ... nothing ... Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Acked-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/vcbuild/include/alloca.h')
0 files changed, 0 insertions, 0 deletions