archive: Various Fixes
- When
git archiveerrors, do not require an exit code, but just use theExitStatuswe already have. This requires less unwrapping. Also, the previous default of 0 was misleading, since 0 is returned upon successful termination. - Use "refname" instead of "refspec" as these are different concepts. Refer to https://git-scm.com/docs/git-check-ref-format and in particular https://git-scm.com/docs/git-check-ref-format#Documentation/git-check-ref-format.txt---refspec-pattern.
- Only allow appending ".tar.gz" to commit IDs, not to refnames,
because refnames may contain the suffix ".tar.gz". It might look
weird, but it is not forbidden to do
git branch foo.tar.gz. char::is_asciidoes not help sanitize refnames to file names. In particular we have'/'.is_ascii() == true. Use the full commit ID instead.
1 commit