mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
acb533440f
The packed/loose format has restrictions on refnames: a and a/b cannot coexist. This limitation does not apply to reftable per se, but must be maintained for interoperability. This code adds validation routines to abort transactions that are trying to add invalid names. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
29 lines
585 B
C
29 lines
585 B
C
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by a BSD-style
|
|
license that can be found in the LICENSE file or at
|
|
https://developers.google.com/open-source/licenses/bsd
|
|
*/
|
|
#ifndef REFNAME_H
|
|
#define REFNAME_H
|
|
|
|
#include "reftable-record.h"
|
|
#include "reftable-generic.h"
|
|
|
|
struct modification {
|
|
struct reftable_table tab;
|
|
|
|
char **add;
|
|
size_t add_len;
|
|
|
|
char **del;
|
|
size_t del_len;
|
|
};
|
|
|
|
int validate_ref_record_addition(struct reftable_table tab,
|
|
struct reftable_ref_record *recs, size_t sz);
|
|
|
|
int modification_validate(struct modification *mod);
|
|
|
|
#endif
|