Merge branch 'kj/refspec-parsing-outside-repository'

"git ls-remote '+refs/tags/*:refs/tags/*' https://..." run outside a
repository would dereference a NULL while trying to see if the given
refspec is a single-object refspec, which has been corrected.

* kj/refspec-parsing-outside-repository:
  refspec: fix typo in comment
  remote-curl: fall back to default hash outside repo
This commit is contained in:
Junio C Hamano
2026-04-01 10:28:19 -07:00
3 changed files with 15 additions and 1 deletions

View File

@@ -1563,6 +1563,13 @@ int cmd_main(int argc, const char **argv)
goto cleanup;
}
/*
* yuck, see 9e89dcb66a (builtin/ls-remote: fall back to SHA1 outside
* of a repo, 2024-08-02)
*/
if (nongit)
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
options.verbosity = 1;
options.progress = !!isatty(2);
options.thin = 1;