• Kirill Smelkov's avatar
    Rewrite in Go · 28986e0e
    Kirill Smelkov authored
    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...
    28986e0e