summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2016-08-08 16:27:36 +0100
committerThibault Saunier <tsaunier@gnome.org>2016-08-09 14:40:27 -0400
commitefb804231d63475ebc45a9098465aef28d92bea4 (patch)
tree18907aa3a3abd6ebc818ab54202ae00aeb22a630
parentbda6c3c6cbcaf870e0f228683dcd3fc4063b5576 (diff)
git-phab: Fix offsets in manually constructed git diffs
The new and old offsets of the start of the file in diffs which are sent to Phabricator must only be zero if the file has been deleted or added, respectively. This was previously backwards in one of the cases, resulting in invalid raw diffs being downloaded from Phabricator, and hence the round-trip `git phab attach; git phab merge` not working. Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk> Differential Revision: https://phabricator.freedesktop.org/D1254
-rwxr-xr-xgit-phab4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-phab b/git-phab
index 20a910e..eabc6aa 100755
--- a/git-phab
+++ b/git-phab
@@ -840,8 +840,8 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
metadata = {"line:first": 0}
hunks = [{
- "newOffset": "0" if diff.new_file else "1",
- "oldOffset": "1" if diff.deleted_file else "0",
+ "newOffset": "0" if diff.deleted_file else "1",
+ "oldOffset": "0" if diff.new_file else "1",
"oldLength": old_length,
"newLength": file_length,
"addLines": added_lines,