Download raw body.
got-portable: Fix "could not parse reference data" on NetBSD
got-portable: Fix "could not parse reference data" on NetBSD
got-portable: Fix "could not parse reference data" on NetBSD
On Wed, Mar 19, 2025 at 04:26:22PM +0000, James Cook wrote: > I found many commands, e.g. 'got br -l', would complain: > got: could not parse reference data > > It seems parse_ref_file() assumes getline() will produce an error > if the file is a directory, e.g. "refs/heads". But on NetBSD > it will (at least sometimes) instead produce binary data that > got tries to parse as a reference. > > The below patch explicitly checks whether the ref is a directory. > Maybe this should go in non-portable got too, at least to keep > the codebases more similar. Could you change the S_ISDIR check to !S_ISREG? That would also cover device nodes, sockets, fifos, etc. ok stsp@ with that change, provided it still works as expected for you and the tests are passing. > (By the way, I noticed that if fstat fails, parse_ref_file doesn't > call get_lockfile_unlock in the cleanup path. Is that an oversight, > or is it that way because we know the program's going to stop soon > anyway, or is it something else? Every other "goto done;" unlocks, > so if it's okay to unlock in that case too, the unlock could be > moved to "done:" to make the code a bit tidier.) Looks like an oversight to me. Could you write a fix for this, too? Thanks!
got-portable: Fix "could not parse reference data" on NetBSD
got-portable: Fix "could not parse reference data" on NetBSD
got-portable: Fix "could not parse reference data" on NetBSD