Skip to content

Commit

Permalink
Merge pull request #22 from Mrono/betterSyncMessages
Browse files Browse the repository at this point in the history
More informative sync error messages
  • Loading branch information
notatestuser committed Apr 27, 2014
2 parents 898c21c + f526b42 commit 308cc6a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/repo.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ module.exports = class Repo
#
# remote_name - String (optional).
# branch_name - String.
# callback - Receives `(err)`.
# callback - Receives `(stderr)`.
#
sync: (remote_name, branch_name, callback) ->

Expand All @@ -392,15 +392,15 @@ module.exports = class Repo

@status (err, status) =>
return callback err if err
@git "stash", {}, ["save", "-u"], (err) =>
return callback err if err
@git "pull", {}, [remote, branch], (err) =>
return callback err if err
@git "push", {}, [remote, branch], (err) =>
return callback err if err
@git "stash", {}, ["save", "-u"], (err, stdout, stderr) =>
return callback stderr if err
@git "pull", {}, [remote, branch], (err, stdout, stderr) =>
return callback stderr if err
@git "push", {}, [remote, branch], (err, stdout, stderr) =>
return callback stderr if err
if not status?.clean
@git "stash", {}, ["pop"], (err) =>
return callback err if err
@git "stash", {}, ["pop"], (err, stdout, stderr) =>
return callback stderr if err
return callback null
else
return callback null
Expand Down

0 comments on commit 308cc6a

Please sign in to comment.