Merge branch 'ab/remove-implicit-use-of-the-repository' into en/header-split-cache-h
* ab/remove-implicit-use-of-the-repository: libs: use "struct repository *" argument, not "the_repository" post-cocci: adjust comments for recent repo_* migration cocci: apply the "revision.h" part of "the_repository.pending" cocci: apply the "rerere.h" part of "the_repository.pending" cocci: apply the "refs.h" part of "the_repository.pending" cocci: apply the "promisor-remote.h" part of "the_repository.pending" cocci: apply the "packfile.h" part of "the_repository.pending" cocci: apply the "pretty.h" part of "the_repository.pending" cocci: apply the "object-store.h" part of "the_repository.pending" cocci: apply the "diff.h" part of "the_repository.pending" cocci: apply the "commit.h" part of "the_repository.pending" cocci: apply the "commit-reach.h" part of "the_repository.pending" cocci: apply the "cache.h" part of "the_repository.pending" cocci: add missing "the_repository" macros to "pending" cocci: sort "the_repository" rules by header cocci: fix incorrect & verbose "the_repository" rules cocci: remove dead rule from "the_repository.pending.cocci"
This commit is contained in:
@ -117,7 +117,7 @@ static int parse_next_oid(const char **next, const char *end,
|
||||
(*next)++;
|
||||
*next = parse_arg(*next, &arg);
|
||||
if (arg.len) {
|
||||
if (get_oid(arg.buf, oid))
|
||||
if (repo_get_oid(the_repository, arg.buf, oid))
|
||||
goto invalid;
|
||||
} else {
|
||||
/* Without -z, an empty value means all zeros: */
|
||||
@ -135,7 +135,7 @@ static int parse_next_oid(const char **next, const char *end,
|
||||
*next += arg.len;
|
||||
|
||||
if (arg.len) {
|
||||
if (get_oid(arg.buf, oid))
|
||||
if (repo_get_oid(the_repository, arg.buf, oid))
|
||||
goto invalid;
|
||||
} else if (flags & PARSE_SHA1_ALLOW_EMPTY) {
|
||||
/* With -z, treat an empty value as all zeros: */
|
||||
@ -550,7 +550,7 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
|
||||
refname = argv[0];
|
||||
value = argv[1];
|
||||
oldval = argv[2];
|
||||
if (get_oid(value, &oid))
|
||||
if (repo_get_oid(the_repository, value, &oid))
|
||||
die("%s: not a valid SHA1", value);
|
||||
}
|
||||
|
||||
@ -561,7 +561,7 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
|
||||
* must not already exist:
|
||||
*/
|
||||
oidclr(&oldoid);
|
||||
else if (get_oid(oldval, &oldoid))
|
||||
else if (repo_get_oid(the_repository, oldval, &oldoid))
|
||||
die("%s: not a valid old SHA1", oldval);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user