Merge branch 'mh/ref-remove-empty-directory'
commit3ad8b5bf26362ac67c9020bf8c30eee54a84f56d
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2017 21:57:12 +0000 (27 13:57 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2017 21:57:12 +0000 (27 13:57 -0800)
tree6355ea894d4920b87ce28f005dcc30603f56882c
parent538569bc8a212a45b7b3f124822b4c3e458752f5
parent446397774ad3b9f2ae81bcfbe0628e99c3db7e49
Merge branch 'mh/ref-remove-empty-directory'

Deletion of a branch "foo/bar" could remove .git/refs/heads/foo
once there no longer is any other branch whose name begins with
"foo/", but we didn't do so so far.  Now we do.

* mh/ref-remove-empty-directory: (23 commits)
  files_transaction_commit(): clean up empty directories
  try_remove_empty_parents(): teach to remove parents of reflogs, too
  try_remove_empty_parents(): don't trash argument contents
  try_remove_empty_parents(): rename parameter "name" -> "refname"
  delete_ref_loose(): inline function
  delete_ref_loose(): derive loose reference path from lock
  log_ref_write_1(): inline function
  log_ref_setup(): manage the name of the reflog file internally
  log_ref_write_1(): don't depend on logfile argument
  log_ref_setup(): pass the open file descriptor back to the caller
  log_ref_setup(): improve robustness against races
  log_ref_setup(): separate code for create vs non-create
  log_ref_write(): inline function
  rename_tmp_log(): improve error reporting
  rename_tmp_log(): use raceproof_create_file()
  lock_ref_sha1_basic(): use raceproof_create_file()
  lock_ref_sha1_basic(): inline constant
  raceproof_create_file(): new function
  safe_create_leading_directories(): set errno on SCLD_EXISTS
  safe_create_leading_directories_const(): preserve errno
  ...
cache.h
refs/files-backend.c
refs/refs-internal.h
sha1_file.c
t/t1400-update-ref.sh
t/t5505-remote.sh