Rewrite in Go
This is more-or-less 1-to-1 port of git-backup to Go. There are things we handle a bit differently: - there is a separate type for Sha1 - conversion of repo paths to git references is now more robust wrt avoiding not-allowed in git constructs like ".." or ".lock" https://git.kernel.org/cgit/git/git.git/tree/refs.c?h=v2.9.0-37-g6d523a3#n34 The rewrite happened because we need to optimize restore, and for e.g. parallelizing part it should be convenient to use goroutines and channels. I'm not very comfortable with how error handling is done, because contrary to what canonical Go way seems to be, in a lot of places it still looks to me exceptions are better idea compared to just error codes, though in many places just error codes are better and makes more sense. Probably there will be less exceptions over time once the code starts to be collaborating set of goroutines with communications done via channels. Still a lot of python habits on my side. And as a bonus we now have end-to-end pull/restore tests...
Showing
.gitignore
0 → 100644
error.go
0 → 100644
error_test.go
0 → 100644
git-backup
deleted
100755 → 0
This diff is collapsed.
git-backup.go
0 → 100644
This diff is collapsed.
git-backup_test.go
0 → 100644
git.go
0 → 100644
gitobjects.go
0 → 100644
misc.go
0 → 100644
set.go
0 → 100644
sha1.go
0 → 100644
testdata/1/dir 2 + β/file 2
0 → 100644
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
testdata/1/dir/world.txt
0 → 100644
testdata/1/file
0 → 100644
testdata/1/fileexec
0 → 100755
testdata/1/symlink.dir
0 → 120000
testdata/1/symlink.file
0 → 120000
testdata/1/symlink.missing
0 → 120000
testdata/2/corrupt.git/HEAD
0 → 100644
File added
File added
File added
util.go
0 → 100644
util_test.go
0 → 100644
Please register or sign in to comment