Skip to content

Commit

Permalink
Bugfix in to_json_patch path.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Sandve Alnæs committed Jan 29, 2016
1 parent 68ffd54 commit acb63a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nbdime/diff_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def source_as_string(source):
return source


def to_json_patch(d, path="/"):
def to_json_patch(d, path=""):
"""Convert nbdime diff object into the RFC6902 JSON Patch format.
This is untested and will need some details worked out.
Expand Down Expand Up @@ -279,5 +279,5 @@ def to_json_patch(d, path="/"):
jp.append({"op": "remove", "path": p_i})
elif op == PATCH:
# JSONPatch has no recursion, recurse here to flatten diff
jp.extend(to_json_patch_format(e.diff, p))
jp.extend(to_json_patch(e.diff, p))
return jp

0 comments on commit acb63a9

Please sign in to comment.