char *ref;
struct expire_reflog_policy_cb cb = { .cmd = cmd };
- if (!dwim_log(argv[i], strlen(argv[i]), NULL, &ref)) {
+ if (!repo_dwim_log(the_repository, argv[i], strlen(argv[i]), NULL, &ref)) {
status |= error(_("%s points nowhere!"), argv[i]);
continue;
}
reflogs = read_complete_reflog(branch);
if (!reflogs || reflogs->nr == 0) {
char *b;
- int ret = dwim_log(branch, strlen(branch),
- NULL, &b);
+ int ret = repo_dwim_log(the_repository, branch, strlen(branch),
+ NULL, &b);
if (ret > 1)
free(b);
else if (ret == 1) {
if (!spec)
return error(_("not a reflog: %s"), rev);
- if (!dwim_log(rev, spec - rev, NULL, &ref)) {
+ if (!repo_dwim_log(the_repository, rev, spec - rev, NULL, &ref)) {
status |= error(_("no reflog for '%s'"), rev);
goto cleanup;
}
return logs_found;
}
-int dwim_log(const char *str, int len, struct object_id *oid, char **log)
-{
- return repo_dwim_log(the_repository, str, len, oid, log);
-}
-
int is_per_worktree_ref(const char *refname)
{
return starts_with(refname, "refs/worktree/") ||
int repo_dwim_ref(struct repository *r, const char *str, int len,
struct object_id *oid, char **ref, int nonfatal_dangling_mark);
int repo_dwim_log(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
-int dwim_log(const char *str, int len, struct object_id *oid, char **ref);
/*
* Retrieves the default branch name for newly-initialized repositories.