Remove submodule from files-backend.c
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest28 patches 9 repliesIn review
- v627 patches 20 repliesSuperseded
- v524 patches 36 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 15 patches | 11 replies | Superseded | |
| v3 | 16 patches | 3 replies | Superseded | |
| v2 | 16 patches | 6 replies | Superseded | |
| v1 | 11 patches | 21 replies | Superseded |
Patches in v7 No applies recorded yet
Reviews trailers per patch
None of the 28 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Michael Haggerty |
|---|---|
| Series | R-b |
| 1/28 | |
| 2/28 | |
| 3/28 | |
| 4/28 | |
| 5/28 | |
| 6/28 | |
| 7/28 | |
| 8/28 | |
| 9/28 | |
| 10/28 | |
| 11/28 | |
| 12/28 | |
| 13/28 | |
| 14/28 | |
| 15/28 | |
| 16/28 | |
| 17/28 | |
| 18/28 | |
| 19/28 | |
| 20/28 | |
| 21/28 | |
| 22/28 | |
| 23/28 | |
| 24/28 | |
| 25/28 | |
| 26/28 | |
| 27/28 | |
| 28/28 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v7 00/28] Remove submodule from files-backend.c
v7 is mostly about style changes except the one bug in test-ref-store.c, missing setup_git_directory().
There's one new patch, 03/28, which maps to the "if (!refs)" deletion in the interdiff.
The one comment from v6 I haven't addressed in v7 is whether to delete REF_STORE_READ. But if it is deleted, I think I'm doing it in nd/worktree-kill-parse-ref, which is partly about cleanup refs code anyway, to avoid another re-roll in this series.
refs.c +6 -9
@@ -1523,18 +1523,15 @@ static struct ref_store *ref_store_init(const char *gitdir,struct ref_store *get_main_ref_store (void ) { -struct ref_store *refs; -if (main_ref_store)return main_ref_store; - refs =ref_store_init (get_git_dir (), - (REF_STORE_READ | -REF_STORE_WRITE | -REF_STORE_ODB | -REF_STORE_MAIN )); - main_ref_store = refs; -return refs; + main_ref_store =ref_store_init (get_git_dir (), + (REF_STORE_READ | +REF_STORE_WRITE | +REF_STORE_ODB | +REF_STORE_MAIN )); +return main_ref_store; }/*
refs/files-backend.c +16 -18
@@ -1195,9 +1195,9 @@ static void files_reflog_path(struct files_ref_store *refs, } } -static void files_refname_path (struct files_ref_store *refs, -struct strbuf *sb, -const char *refname) +static void files_ref_path (struct files_ref_store *refs, +struct strbuf *sb, +const char *refname) {switch (ref_type (refname)) {case REF_TYPE_PER_WORKTREE :
@@ -1283,7 +1283,7 @@ static void read_loose_refs(const char *dirname, struct ref_dir *dir)struct strbuf path =STRBUF_INIT ;size_t path_baselen; -files_refname_path (refs, &path, dirname); +files_ref_path (refs, &path, dirname); path_baselen = path.len; d =opendir (path.buf);
@@ -1420,7 +1420,7 @@ static int files_read_raw_ref(struct ref_store *ref_store, *type =0 ;strbuf_reset (&sb_path); -files_refname_path (refs, &sb_path, refname); +files_ref_path (refs, &sb_path, refname); path = sb_path.buf;
@@ -1608,7 +1608,7 @@ static int lock_raw_ref(struct files_ref_store *refs, *lock_p = lock =xcalloc (1 ,sizeof (*lock)); lock->ref_name =xstrdup (refname); -files_refname_path (refs, &ref_file, refname); +files_ref_path (refs, &ref_file, refname); retry:switch (safe_create_leading_directories (ref_file.buf)) {
@@ -1949,8 +1949,6 @@ static struct ref_iterator *files_ref_iterator_begin( refs =files_downcast (ref_store,REF_STORE_READ | (ref_paranoia ?0 :REF_STORE_ODB ),"ref_iterator_begin" ); -if (!refs) -return empty_ref_iterator_begin (); iter =xcalloc (1 ,sizeof (*iter)); ref_iterator = &iter->base;
@@ -2086,7 +2084,7 @@ static struct ref_lock *lock_ref_sha1_basic(struct files_ref_store *refs,if (flags &REF_DELETING ) resolve_flags |=RESOLVE_REF_ALLOW_BAD_NAME ; -files_refname_path (refs, &ref_file, refname); +files_ref_path (refs, &ref_file, refname); resolved = !!refs_resolve_ref_unsafe (&refs->base, refname, resolve_flags, lock->old_oid.hash, type);
@@ -2387,7 +2385,7 @@ static void try_remove_empty_parents(struct files_ref_store *refs,strbuf_setlen (&buf, q - buf.buf);strbuf_reset (&sb); -files_refname_path (refs, &sb, buf.buf); +files_ref_path (refs, &sb, buf.buf);if ((flags &REMOVE_EMPTY_PARENTS_REF ) &&rmdir (sb.buf)) flags &= ~REMOVE_EMPTY_PARENTS_REF ;
@@ -2709,7 +2707,7 @@ static int files_rename_ref(struct ref_store *ref_store,struct strbuf path =STRBUF_INIT ;int result; -files_refname_path (refs, &path, newrefname); +files_ref_path (refs, &path, newrefname); result =remove_empty_directories (&path);strbuf_release (&path);
@@ -2935,10 +2933,10 @@ static int log_ref_write_fd(int fd, const unsigned char *old_sha1,return 0 ; } -int files_log_ref_write (struct files_ref_store *refs, -const char *refname,const unsigned char *old_sha1, -const unsigned char *new_sha1,const char *msg, -int flags,struct strbuf *err) +static int files_log_ref_write (struct files_ref_store *refs, +const char *refname,const unsigned char *old_sha1, +const unsigned char *new_sha1,const char *msg, +int flags,struct strbuf *err) {int logfd, result;
@@ -3957,7 +3955,7 @@ static int files_transaction_commit(struct ref_store *ref_store, update->type & REF_ISSYMREF) {/* It is a loose reference. */ strbuf_reset (&sb); -files_refname_path (refs, &sb, lock->ref_name); +files_ref_path (refs, &sb, lock->ref_name);if (unlink_or_msg (sb.buf, err)) { ret =TRANSACTION_GENERIC_ERROR ; goto cleanup;
@@ -4266,11 +4264,11 @@ static int files_init_db(struct ref_store *ref_store, struct strbuf *err)/* * Create .git/refs/{heads,tags} */ -files_refname_path (refs, &sb,"refs/heads" ); +files_ref_path (refs, &sb,"refs/heads" );safe_create_dir (sb.buf,1 );strbuf_reset (&sb); -files_refname_path (refs, &sb,"refs/tags" ); +files_ref_path (refs, &sb,"refs/tags" );safe_create_dir (sb.buf,1 );strbuf_release (&sb);
submodule.c +0 -5
@@ -1597,11 +1597,6 @@ const char *get_superproject_working_tree(void)return ret; } -/* -* Given a submodule path (as in the index), return the repository -* path of that submodule in 'buf'. Return -1 on error or when the -* submodule is not initialized. -*/ int submodule_to_gitdir (struct strbuf *buf,const char *submodule) {const struct submodule *sub;
submodule.h +5 -0
@@ -81,6 +81,11 @@ extern int push_unpushed_submodules(struct sha1_array *commits, int dry_run);extern void connect_work_tree_and_git_dir (const char *work_tree,const char *git_dir);extern int parallel_submodules (void ); +/* +* Given a submodule path (as in the index), return the repository +* path of that submodule in 'buf'. Return -1 on error or when the +* submodule is not initialized. +*/ int submodule_to_gitdir (struct strbuf *buf,const char *submodule);/*
t/helper/test-ref-store.c +2 -0
@@ -261,6 +261,8 @@ int cmd_main(int argc, const char **argv)const char *func;struct command *cmd; +setup_git_directory (); + argv =get_store (argv +1 , &refs); func = *argv++;
Signature · 1 line
2.11.0.157.gd943d85