summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* do_for_each_entry_in_dir(): delete functionmh/separate-ref-cacheMichael Haggerty2017-04-162-32/+0
| | | | | | | Its only remaining caller was itself. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files_pack_refs(): use reference iterationMichael Haggerty2017-04-161-83/+60
| | | | | | | | | | | | | | Use reference iteration rather than `do_for_each_entry_in_dir()` in the definition of `files_pack_refs()`. This makes the code shorter and easier to follow, because the logic can be inline rather than spread between the main function and a callback function, and it removes the need to use `pack_refs_cb_data` to preserve intermediate state. This removes the last callers of `entry_resolves_to_object()` and `get_loose_ref_dir()`, so delete those functions. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* commit_packed_refs(): use reference iterationMichael Haggerty2017-04-161-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use reference iteration rather than do_for_each_entry_in_dir() in the definition of commit_packed_refs(). Note that an internal consistency check that was previously done in `write_packed_entry_fn()` is not there anymore. This is actually an improvement: The old error message was emitted when there is an entry in the packed-ref cache that is not `REF_KNOWS_PEELED`, and when we attempted to peel the reference, the result was `PEEL_INVALID`, `PEEL_IS_SYMREF`, or `PEEL_BROKEN`. Since a packed ref cannot be a symref, `PEEL_IS_SYMREF` and `PEEL_BROKEN` can be ruled out. So we're left with `PEEL_INVALID`. An entry without `REF_KNOWS_PEELED` can get into the packed-refs cache in the following two ways: * The reference was read from a `packed-refs` file that didn't have the `fully-peeled` attribute. In that case, we *don't want* to emit an error, because the broken value is presumably a stale value of the reference that is now masked by a loose version of the same reference (which we just don't happen to be packing this time). This is a perfectly legitimate situation and doesn't indicate that the repository is corrupt. The old code incorrectly emits an error message in this case. (It was probably never reported as a bug because this scenario is rare.) * The reference was a loose reference that was just added to the packed ref cache by `files_packed_refs()` via `pack_if_possible_fn()` in preparation for being packed. The latter function refuses to pack a reference for which `entry_resolves_to_object()` returns false, and otherwise calls `peel_entry()` itself and checks the return value. So an entry added this way should always have `REF_KNOWS_PEELED` and shouldn't trigger the error message in either the old code or the new. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cache_ref_iterator_begin(): make function smarterMichael Haggerty2017-04-163-53/+56
| | | | | | | | | | | | | | | | | | Change `cache_ref_iterator_begin()` to take two new arguments: * `prefix` -- to iterate only over references with the specified prefix. * `prime_dir` -- to "prime" (i.e., pre-load) the cache before starting the iteration. The new functionality makes it possible for `files_ref_iterator_begin()` to be made more ignorant of the internals of `ref_cache`, and `find_containing_dir()` and `prime_ref_dir()` to be made private. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* get_loose_ref_cache(): new functionMichael Haggerty2017-04-161-2/+7
| | | | | | | | | Extract a new function, `get_loose_ref_cache()`, from get_loose_ref_dir(). The function returns the `ref_cache` for the loose refs of a `files_ref_store`. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* get_loose_ref_dir(): function renamed from get_loose_refs()Michael Haggerty2017-04-161-3/+3
| | | | | | | The new name is more analogous to `get_packed_ref_dir()`. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* do_for_each_entry_in_dir(): eliminate `offset` argumentMichael Haggerty2017-04-163-11/+10
| | | | | | | It was never used. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: handle "refs/bisect/" in `loose_fill_ref_dir()`Michael Haggerty2017-04-162-16/+15
| | | | | | | | | | That "refs/bisect/" has to be handled specially when filling the ref_cache for loose references is a peculiarity of the files backend, and the ref-cache code shouldn't need to know about it. So move this code to the callback function, `loose_fill_ref_dir()`. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ref-cache: use a callback function to fill the cacheMichael Haggerty2017-04-163-13/+38
| | | | | | | | | | | | | | | | It is a leveling violation for `ref_cache` to know about `files_ref_store` or that it should call `read_loose_refs()` to lazily fill cache directories. So instead, have its constructor take as an argument a callback function that it should use for lazy-filling, and change `files_ref_store` to supply a pointer to function `read_loose_refs` (renamed to `loose_fill_ref_dir`) when creating the ref cache for its loose refs. This means that we can generify the type of the back-pointer in `struct ref_cache` from `files_ref_store` to `ref_store`. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: record the ref_store in ref_cache, not ref_dirMichael Haggerty2017-04-163-11/+16
| | | | | | | | | | | | | | | | | | | Instead of keeping a pointer to the `ref_store` in every `ref_dir` entry, store it once in `struct ref_cache`, and change `struct ref_dir` to include a pointer to its containing `ref_cache` instead. This makes it easier to add to the information that is accessible from a `ref_dir` without increasing the size of every `ref_dir` instance. Note that previously, every `ref_dir` pointed at the containing `files_ref_store` regardless of whether it was a part of the loose or packed reference cache. Now we have to be sure to initialize the instances to point at the correct containing `ref_cache`. So change `create_dir_entry()` to take a `ref_cache` parameter, and change its callers to pass the correct `ref_cache` depending on the purpose of the new `dir_entry`. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ref-cache: introduce a new type, ref_cacheMichael Haggerty2017-04-163-13/+46
| | | | | | | | | | | | | For now, it just wraps a `ref_entry *` that points at the root of the tree. Soon it will hold more information. Add two new functions, `create_ref_cache()` and `free_ref_cache()`. Make `free_ref_entry()` private. Change files-backend to use this type to hold its caches. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: split `ref_cache` code into separate filesMichael Haggerty2017-04-164-733/+767
| | | | | | | | | | | | | | | | | The `ref_cache` code is currently too tightly coupled to `files-backend`, making the code harder to understand and making it awkward for new code to use `ref_cache` (as we indeed have planned). Start loosening that coupling by splitting `ref_cache` into a separate module. This commit moves code, adds declarations, and changes the visibility of some functions, but doesn't change any code. The modules are still too tightly coupled, but the situation will be improved in subsequent commits. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ref-cache: rename `remove_entry()` to `remove_entry_from_dir()`Michael Haggerty2017-04-161-2/+2
| | | | | | | | This function's visibility is about to be increased, so give it a more distinctive name. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ref-cache: rename `find_ref()` to `find_ref_entry()`Michael Haggerty2017-04-161-3/+3
| | | | | | | | This function's visibility is about to be increased, so give it a more distinctive name. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ref-cache: rename `add_ref()` to `add_ref_entry()`Michael Haggerty2017-04-161-4/+4
| | | | | | | | This function's visibility is about to be increased, so give it a more distinctive name. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs_verify_refname_available(): use function in more placesMichael Haggerty2017-04-161-160/+11
| | | | | | | | | | | | | | | Change `lock_raw_ref()` and `lock_ref_sha1_basic()` to use `refs_verify_refname_available()` instead of `verify_refname_available_dir()`. This means that those callsites now check for conflicts with all references rather than just packed refs, but the performance cost shouldn't be significant (and will be regained later). These were the last callers of `verify_refname_available_dir()`, so also delete that (very complicated) function. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs_verify_refname_available(): implement once for all backendsMichael Haggerty2017-04-164-41/+92
| | | | | | | | | | | It turns out that we can now implement `refs_verify_refname_available()` based on the other virtual functions, so there is no need for it to be defined at the backend level. Instead, define it once in `refs.c` and remove the `files_backend` definition. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs_ref_iterator_begin(): new functionMichael Haggerty2017-04-142-2/+24
| | | | | | | | Extract a new function from `do_for_each_ref()`. It will be useful elsewhere. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs_read_raw_ref(): new functionMichael Haggerty2017-04-142-2/+13
| | | | | | | | Extract a new function from `refs_resolve_ref_unsafe()`. It will be useful elsewhere. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* get_ref_dir(): don't call read_loose_refs() for "refs/bisect"Michael Haggerty2017-04-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since references under "refs/bisect/" are per-worktree, they have to be sought in the worktree rather than in the main repository. But since loose references are found by traversing directories, the reference iterator won't even get the idea to look for a "refs/bisect/" directory in the worktree if there is not a directory with that name in the main repository. Thus `get_ref_dir()` manually inserts a dir_entry for "refs/bisect/" whenever it reads the entry for "refs/". The current code then immediately calls `read_loose_refs()` on that directory. But since the dir_entry is created with its `incomplete` flag set, any traversal that gets to this point will read the directory automatically. So there is no need to call `read_loose_refs()` explicitly; the lazy mechanism suffices. And in fact, the attempt to `read_loose_refs()` was broken anyway. That function needs its `dirname` argument to have a trailing `/` character, but the invocation here was passing it "refs/bisect" without a trailing slash. So `read_loose_refs()` would read `$GIT_DIR/refs/bisect" correctly, but if it found an entry "foo" in that directory, it would try to read "$GIT_DIR/refs/bisectfoo". Normally it wouldn't find anything at that path, but the failure was canceled out because `get_ref_dir()` *also* forgot to reset the `REF_INCOMPLETE` bit on the dir_entry. So the read was attempted again when it was accessed, via the lazy mechanism, and this time the read was done correctly. This code has been broken since it was first introduced. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.h: add a note about sorting order of for_each_ref_*nd/files-backend-git-dirNguyễn Thái Ngọc Duy2017-04-143-2/+14
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t1406: new tests for submodule ref storeNguyễn Thái Ngọc Duy2017-04-141-0/+95
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t1405: some basic tests on main ref storeNguyễn Thái Ngọc Duy2017-04-141-0/+123
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t/helper: add test-ref-store to test ref-store functionsNguyễn Thái Ngọc Duy2017-04-143-0/+279
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: delete pack_refs() in favor of refs_pack_refs()Nguyễn Thái Ngọc Duy2017-04-143-7/+1
| | | | | | | It only has one caller, not worth keeping just for convenience. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: avoid ref api targeting main ref storeNguyễn Thái Ngọc Duy2017-04-141-35/+49
| | | | | | | | | | | | | | | | | A small step towards making files-backend work as a non-main ref store using the newly added store-aware API. For the record, `join` and `nm` on refs.o and files-backend.o tell me that files-backend no longer uses functions that default to get_main_ref_store(). I'm not yet comfortable at the idea of removing files_assert_main_repository() (or converting REF_STORE_MAIN to REF_STORE_WRITE). More staring and testing is required before that can happen. Well, except peel_ref(). I'm pretty sure that function is safe. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: new transaction related ref-store apiNguyễn Thái Ngọc Duy2017-04-143-12/+53
| | | | | | | | The transaction struct now takes a ref store at creation and will operate on that ref store alone. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: add new ref-store apiNguyễn Thái Ngọc Duy2017-04-144-99/+270
| | | | | | | | | This is not meant to cover all existing API. It adds enough to test ref stores with the new test program test-ref-store, coming soon and to be used by files-backend.c. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: rename get_ref_store() to get_submodule_ref_store() and make it publicNguyễn Thái Ngọc Duy2017-04-143-16/+19
| | | | | | | | | This function is intended to replace *_submodule() refs API. It provides a ref store for a specific submodule, which can be operated on by a new set of refs API. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: replace submodule_allowed check in files_downcast()Nguyễn Thái Ngọc Duy2017-04-143-37/+73
| | | | | | | | | | | | | | | | | | | | | | | | files-backend.c is unlearning submodules. Instead of having a specific check for submodules to see what operation is allowed, files backend now takes a set of flags at init. Each operation will check if the required flags is present before performing. For now we have four flags: read, write and odb access. Main ref store has all flags, obviously, while submodule stores are read-only and have access to odb (*). The "main" flag stays because many functions in the backend calls frontend ones without a ref store, so these functions always target the main ref store. Ideally the flag should be gone after ref-store-aware api is in place and used by backends. (*) Submodule code needs for_each_ref. Try take REF_STORE_ODB flag out. At least t3404 would fail. The "have access to odb" in submodule is a bit hacky since we don't know from he whether add_submodule_odb() has been called. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: move submodule code out of files-backend.cNguyễn Thái Ngọc Duy2017-03-273-32/+20
| | | | | | | | | | | | | | | files-backend is now initialized with a $GIT_DIR. Converting a submodule path to where real submodule gitdir is located is done in get_ref_store(). This gives a slight performance improvement for submodules since we don't convert submodule path to gitdir at every backend call like before. We pay that once at ref-store creation. More cleanup in files_downcast() and files_assert_main_repository() follows shortly. It's separate to keep noises from this patch. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* path.c: move some code out of strbuf_git_path_submodule()Nguyễn Thái Ngọc Duy2017-03-273-28/+44
| | | | | | | | | refs is learning to avoid path rewriting that is done by strbuf_git_path_submodule(). Factor out this code so it could be reused by refs_* functions. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: make get_main_ref_store() public and use itNguyễn Thái Ngọc Duy2017-03-273-19/+22
| | | | | | | | | | get_ref_store() will soon be renamed to get_submodule_ref_store(). Together with future get_worktree_ref_store(), the three functions provide an appropriate ref store for different operation modes. New APIs will be added to operate directly on ref stores. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: kill register_ref_store(), add register_submodule_ref_store()Nguyễn Thái Ngọc Duy2017-03-271-25/+20
| | | | | | | | | | This is the last function in this code (besides public API) that takes submodule argument and handles both main/submodule cases. Break it down, move main store registration in get_main_ref_store() and keep the rest in register_submodule_ref_store(). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: flatten get_ref_store() a bitNguyễn Thái Ngọc Duy2017-03-271-10/+13
| | | | | | | | | | This helps the future changes in this code. And because get_ref_store() is destined to become get_submodule_ref_store(), the "get main store" code path will be removed eventually. After this the patch to delete that code will be cleaner. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs: rename lookup_ref_store() to lookup_submodule_ref_store()Nguyễn Thái Ngọc Duy2017-03-271-9/+4
| | | | | | | | | With get_main_ref_store() being used inside get_ref_store(), lookup_ref_store() is only used for submodule code path. Rename to reflect that and delete dead code. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: introduce get_main_ref_store()Nguyễn Thái Ngọc Duy2017-03-271-4/+9
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: remove the use of git_path()Nguyễn Thái Ngọc Duy2017-03-271-5/+38
| | | | | | | | | | | | | Given $GIT_DIR and $GIT_COMMON_DIR, files-backend is now in charge of deciding what goes where (*). The end goal is to pass $GIT_DIR only. A refs "view" of a linked worktree is a logical ref store that combines two files backends together. (*) Not entirely true since strbuf_git_path_submodule() still does path translation underneath. But that's for another patch. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: add and use files_ref_path()Nguyễn Thái Ngọc Duy2017-03-271-24/+23
| | | | | | | | | | | | Keep repo-related path handling in one place. This will make it easier to add submodule/multiworktree support later. This automatically adds the "if submodule then use the submodule version of git_path" to other call sites too. But it does not mean those operations are submodule-ready. Not yet. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: add and use files_reflog_path()Nguyễn Thái Ngọc Duy2017-03-271-56/+86
| | | | | | | | Keep repo-related path handling in one place. This will make it easier to add submodule/multiworktree support later. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: move "logs/" out of TMP_RENAMED_LOGNguyễn Thái Ngọc Duy2017-03-271-5/+5
| | | | | | | | | | | | This makes reflog path building consistent, always in the form of strbuf_git_path(sb, "logs/%s", refname); It reduces the mental workload a bit in the next patch when that function call is converted. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: convert git_path() to strbuf_git_path()Nguyễn Thái Ngọc Duy2017-03-271-33/+97
| | | | | | | | | | | git_path() and friends are going to be killed in files-backend.c in near future. And because there's a risk with overwriting buffer in git_path(), let's convert them all to strbuf_git_path(). We'll have easier time killing/converting strbuf_git_path() then because we won't have to worry about memory management again. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: make sure files_rename_ref() always reach the endNguyễn Thái Ngọc Duy2017-03-271-14/+28
| | | | | | | | This is a no-op patch. It prepares the function so that we can release resources (to be added later in this function) before we return. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: add and use files_packed_refs_path()Nguyễn Thái Ngọc Duy2017-03-271-11/+18
| | | | | | | | Keep repo-related path handling in one place. This will make it easier to add submodule/multiworktree support later. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: delete dead code in files_init_db()Nguyễn Thái Ngọc Duy2017-03-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | safe_create_dir() can do adjust_shared_perm() internally, and init-db has always created 'refs' in shared mode since the beginning, af6e277c5e (git-init-db: initialize shared repositories with --shared - 2005-12-22). So this code looks like extra adjust_shared_perm calls are unnecessary. And they are. But let's see why there are here in the first place. This code was added in 6fb5acfd8f (refs: add methods to init refs db - 2016-09-04). From the diff alone this looks like a faithful refactored code from init-db.c. But there is a subtle difference: Between the safe_create_dir() block and adjust_shared_perm() block in the old init-db.c, we may copy/recreate directories from the repo template. So it makes sense that adjust_shared_perm() is re-executed then to fix potential permission screwups. After 6fb5acfd8f, refs dirs are created after template is copied. Nobody will change directory permission again. So the extra adjust_shared_perm() is redudant. Delete them. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend.c: delete dead code in files_ref_iterator_begin()Nguyễn Thái Ngọc Duy2017-03-271-3/+0
| | | | | | | | | | It's not in the diff context, but files_downcast() is called before this check. If "refs" is NULL, we would have segfaulted before reaching the check here. And we should never see NULL refs in backend code (frontend should have caught it). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* files-backend: make files_log_ref_write() staticNguyễn Thái Ngọc Duy2017-03-272-7/+6
| | | | | | | | Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10) but probably never used outside refs-internal.c Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.h: add forward declaration for structs used in this fileNguyễn Thái Ngọc Duy2017-03-181-0/+4
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fifth batch for 2.13Junio C Hamano2017-03-171-9/+54
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jk/cherry-pick-0-mainline'Junio C Hamano2017-03-172-1/+29
|\ | | | | | | | | | | | | | | | | | | | | "git revert -m 0 $merge_commit" complained that reverting a merge needs to say relative to which parent the reversion needs to happen, as if "-m 0" weren't given. The correct diagnosis is that "-m 0" does not refer to the first parent ("-m 1" does). This has been fixed. * jk/cherry-pick-0-mainline: cherry-pick: detect bogus arguments to --mainline