Add support for submodules in gitfs#120
Conversation
|
Without this, trying to run
|
|
I applied this to my own builds and it worked successfully: tianon/bashbrew-tianon-meta@b491ee4#diff-b5258a02eeb8ebad56e128d41fdf1cc6b6bb9e5523199bcb868ee7076cbf2ea1 |
|
I did not verify that |
For now, these emulate the support that `git archive` has for them (namely, that they present as empty directories, which are otherwise impossible to create/represent in Git).
83b9cd4 to
fb05da1
Compare
|
I'm glad I explicitly tested it! It caught a bug. 😄 See tianon/bashbrew-tianon-meta@ce8717b#diff-b5258a02eeb8ebad56e128d41fdf1cc6b6bb9e5523199bcb868ee7076cbf2ea1 for where applying the latest fixed it. `tar-scrubber.go`package main
import (
"archive/tar"
"io"
"os"
)
func main() {
in := tar.NewReader(os.Stdin)
out := tar.NewWriter(os.Stdout)
defer out.Flush() // note: flush instead of close to avoid the empty block at EOF
var zero tar.Header
for {
hdr, err := in.Next()
if err == io.EOF {
break
}
if err != nil {
panic(err)
}
hdr.Uid = zero.Uid
hdr.Gid = zero.Gid
hdr.Uname = zero.Uname
hdr.Gname = zero.Gname
hdr.ModTime = zero.ModTime
hdr.AccessTime = zero.AccessTime
hdr.ChangeTime = zero.ChangeTime
if err := out.WriteHeader(hdr); err != nil {
panic(err)
}
if _, err := io.Copy(out, in); err != nil {
panic(err)
}
}
}$ git archive --format=tar d12af8e5556e39f82082b44628288e2eb27d4c34:./ | go run ./tar-scrubber.go | sha256sum
3af10ded9c88b401f84baf4c72ad4d4dc3a72f614c4704e863b1d79e49c88faa - "reproducibleGitChecksum": "3af10ded9c88b401f84baf4c72ad4d4dc3a72f614c4704e863b1d79e49c88faa", |
For now, these emulate the support that
git archivehas for them (namely, that they present as empty directories, which are otherwise impossible to create/represent in Git).