Kill manual ref parsing code in worktree.c
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest6 patches 1 replyIn review
- v45 patches 6 repliesSuperseded
- v34 patches 7 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 5 patches | 0 replies | Superseded | |
| v1 RFC | 2 patches | 10 replies | Superseded |
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | environment.c: fix potential segfault by get_git_common_dir()environment.c | +2 | 0 replies | |
| 2/6 | refs.c: make submodule ref store hashmap genericrefs.c | +32 | 0 replies | |
| 3/6 | refs: add REFS_STORE_ALL_CAPSrefs.c refs/ | +5 | 0 replies | |
| 4/6 | refs: introduce get_worktree_ref_store()refs.c refs.h | +32 | 0 replies | |
| 5/6 | worktree.c: kill parse_ref() in favor of refs_resolve_ref_unsafe()branch.c t/ t/ +2 more | +88 | 0 replies | |
| 6/6 | refs: kill set_worktree_head_symref()branch.c refs.h refs/ +1 more | +18 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH v5 0/6] Kill manual ref parsing code in worktree.c
v5 chanes are mostly cosmetic:
refs.c +3 -10
@@ -1530,11 +1530,7 @@ struct ref_store *get_main_ref_store(void)if (main_ref_store)return main_ref_store; - main_ref_store =ref_store_init (get_git_dir (), - (REF_STORE_READ | -REF_STORE_WRITE | -REF_STORE_ODB | -REF_STORE_MAIN )); + main_ref_store =ref_store_init (get_git_dir (),REF_STORE_ALL_CAPS );return main_ref_store; }
@@ -1597,9 +1593,6 @@ struct ref_store *get_submodule_ref_store(const char *submodule)struct ref_store *get_worktree_ref_store (const struct worktree *wt) {struct ref_store *refs; -unsigned int refs_all_capabilities = -REF_STORE_READ |REF_STORE_WRITE | -REF_STORE_ODB |REF_STORE_MAIN ;const char *id;if (wt->is_current)
@@ -1612,10 +1605,10 @@ struct ref_store *get_worktree_ref_store(const struct worktree *wt)if (wt->id) refs =ref_store_init (git_common_path ("worktrees/%s" , wt->id), - refs_all_capabilities); +REF_STORE_ALL_CAPS );else refs =ref_store_init (get_git_common_dir (), - refs_all_capabilities); +REF_STORE_ALL_CAPS );if (refs) register_ref_store_map(&worktree_ref_stores, "worktree",
refs/refs-internal.h +4 -0
@@ -467,6 +467,10 @@ struct ref_store;#define REF_STORE_WRITE (1 << 1)/* can perform update operations */ #define REF_STORE_ODB (1 << 2)/* has access to object database */ #define REF_STORE_MAIN (1 << 3) +#define REF_STORE_ALL_CAPS (REF_STORE_READ | \ + REF_STORE_WRITE | \ + REF_STORE_ODB | \ + REF_STORE_MAIN)/* * Initialize the ref_store for the specified gitdir. These functions
Nguyễn Thái Ngọc Duy (6):
environment.c: fix potential segfault by get_git_common_dir() refs.c: make submodule ref store hashmap generic
refs: add REFS_STORE_ALL_CAPS
refs: introduce get_worktree_ref_store()
worktree.c: kill parse_ref() in favor of refs_resolve_ref_unsafe()
refs: kill set_worktree_head_symref()
branch.c | 15 ++--- environment.c | 2 + refs.c | 100 ++++++++++++++++++++------------ refs.h | 12 +--- refs/files-backend.c | 44 -------------- refs/refs-internal.h | 4 ++ t/helper/test-ref-store.c | 18 ++++++ t/t1407-worktree-ref-store.sh (new +x) | 52 +++++++++++++++++ worktree.c | 102 +++++++++------------------------ worktree.h | 2 +- 10 files changed, 177 insertions(+), 174 deletions(-) create mode 100755 t/t1407-worktree-ref-store.sh
Signature · 1 line
2.11.0.157.gd943d85