Skip to content

Commit

Permalink
push: remoteMkdirAll parent to get parent
Browse files Browse the repository at this point in the history
Fixes #130
  • Loading branch information
odeke-em committed Mar 29, 2015
1 parent de94fed commit 74646cc
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,14 @@ func (g *Commands) PushPiped() (err error) {
}

parentPath := g.parentPather(relToRootPath)
parent, pErr := g.rem.FindByPath(parentPath)
if pErr != nil {
spin := g.playabler()
spin.play()
parent, pErr = g.remoteMkdirAll(parentPath)
spin.stop()
if pErr != nil || parent == nil {
g.log.LogErrf("%s: %v", relToRootPath, pErr)
return
}

spin := g.playabler()
spin.play()
parent, pErr := g.remoteMkdirAll(parentPath)
spin.stop()

if pErr != nil || parent == nil {
return fmt.Errorf("%s: %v", relToRootPath, pErr)
}

args := upsertOpt{
Expand Down Expand Up @@ -279,7 +277,7 @@ func (g *Commands) remoteMod(change *Change) (err error) {
}

parentPath := g.parentPather(change.Path)
parent, err = g.rem.FindByPath(parentPath)
parent, err = g.remoteMkdirAll(parentPath)

if err != nil {
return err
Expand Down

0 comments on commit 74646cc

Please sign in to comment.