Merge branch 'en/shallow-exclude-takes-a-ref-fix'

The "--shallow-exclude=<ref>" option to various history transfer
commands takes a ref, not an arbitrary revision.

* en/shallow-exclude-takes-a-ref-fix:
  doc: correct misleading descriptions for --shallow-exclude
  upload-pack: fix ambiguous error message
This commit is contained in:
Junio C Hamano
2024-11-13 08:35:32 +09:00
8 changed files with 21 additions and 10 deletions

View File

@ -1026,10 +1026,14 @@ static int process_deepen_not(const char *line, struct oidset *deepen_not, int *
{
const char *arg;
if (skip_prefix(line, "deepen-not ", &arg)) {
int cnt;
char *ref = NULL;
struct object_id oid;
if (expand_ref(the_repository, arg, strlen(arg), &oid, &ref) != 1)
cnt = expand_ref(the_repository, arg, strlen(arg), &oid, &ref);
if (cnt > 1)
die("git upload-pack: ambiguous deepen-not: %s", line);
if (cnt < 1)
die("git upload-pack: deepen-not is not a ref: %s", line);
oidset_insert(deepen_not, &oid);
free(ref);
*deepen_rev_list = 1;