Not sure if from
, to
in diff.FilePatch.Files()
is reversed
#1061
-
I'm trying to go through the log of a repository and output if a file has been added, deleted or modified. This is the code should print a line with When looking at a commit that added a file, the
To see this for yourself do this: $ git clone https://github.com/zregvart/go-git-patch.git
$ cd go-git-patch
$ go run main.go This prints:
And I'm expecting it to print:
That is, in What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think your lines 51 and 52 are incorrect/back to front. Patch gives you the patch from 1 commit to the next, so you want from the parent to the child, ie your code should look something like:
|
Beta Was this translation helpful? Give feedback.
I think your lines 51 and 52 are incorrect/back to front. Patch gives you the patch from 1 commit to the next, so you want from the parent to the child, ie your code should look something like: