mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'sj/ref-contents-check'
"git fsck" learned to issue warnings on "curiously formatted" ref contents that have always been taken valid but something Git wouldn't have written itself (e.g., missing terminating end-of-line after the full object name). * sj/ref-contents-check: ref: add symlink ref content check for files backend ref: check whether the target of the symref is a ref ref: add basic symref content check for files backend ref: add more strict checks for regular refs ref: port git-fsck(1) regular refs check for files backend ref: support multiple worktrees check for refs ref: initialize ref name outside of check functions ref: check the full refname instead of basename ref: initialize "fsck_ref_report" with zero
This commit is contained in:
7
refs.c
7
refs.c
@@ -318,9 +318,10 @@ int check_refname_format(const char *refname, int flags)
|
||||
return check_or_sanitize_refname(refname, flags, NULL);
|
||||
}
|
||||
|
||||
int refs_fsck(struct ref_store *refs, struct fsck_options *o)
|
||||
int refs_fsck(struct ref_store *refs, struct fsck_options *o,
|
||||
struct worktree *wt)
|
||||
{
|
||||
return refs->be->fsck(refs, o);
|
||||
return refs->be->fsck(refs, o, wt);
|
||||
}
|
||||
|
||||
void sanitize_refname_component(const char *refname, struct strbuf *out)
|
||||
@@ -1791,7 +1792,7 @@ static int refs_read_special_head(struct ref_store *ref_store,
|
||||
}
|
||||
|
||||
result = parse_loose_ref_contents(ref_store->repo->hash_algo, content.buf,
|
||||
oid, referent, type, failure_errno);
|
||||
oid, referent, type, NULL, failure_errno);
|
||||
|
||||
done:
|
||||
strbuf_release(&full_path);
|
||||
|
||||
Reference in New Issue
Block a user