git/refs
Nguyễn Thái Ngọc Duy b9317d55a3 Make sure refs/rewritten/ is per-worktree
a9be29c981 (sequencer: make refs generated by the `label` command
worktree-local, 2018-04-25) adds refs/rewritten/ as per-worktree
reference space. Unfortunately (my bad) there are a couple places that
need update to make sure it's really per-worktree.

 - add_per_worktree_entries_to_dir() is updated to make sure ref listing
   look at per-worktree refs/rewritten/ instead of per-repo one [1]

 - common_list[] is updated so that git_path() returns the correct
   location. This includes "rev-parse --git-path".

This mess is created by me. I started trying to fix it with the
introduction of refs/worktree, where all refs will be per-worktree
without special treatments. Unfortunate refs/rewritten came before
refs/worktree so this is all we can do.

This also fixes logs/refs/worktree not being per-worktree.

[1] note that ref listing still works sometimes. For example, if you
    have .git/worktrees/foo/refs/rewritten/bar AND the directory
    .git/worktrees/refs/rewritten, refs/rewritten/bar will show up.
    add_per_worktree_entries_to_dir() is only needed when the directory
    .git/worktrees/refs/rewritten is missing.

Reported-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-08 11:57:47 +09:00
..
files-backend.c Make sure refs/rewritten/ is per-worktree 2019-03-08 11:57:47 +09:00
iterator.c refs.c: migrate internal ref iteration to pass thru repository argument 2018-08-21 10:22:50 -07:00
packed-backend.c refs/packed-backend: express constants using the_hash_algo 2018-10-15 12:53:15 +09:00
packed-backend.h refs/packed-backend.h: add missing declaration (hdr-check) 2018-09-20 11:50:00 -07:00
ref-cache.c convert "oidcmp() != 0" to "!oideq()" 2018-08-29 11:32:49 -07:00
ref-cache.h refs/ref-cache.h: add missing declarations (hdr-check) 2018-09-20 11:50:00 -07:00
refs-internal.h Merge branch 'rj/header-check' 2018-10-16 16:16:00 +09:00