Commit graph

5 commits

Author SHA1 Message Date
zeripath 7a428fae4b
Ensure that all unmerged files are merged when conflict checking ()
There is a subtle bug in the code relating to collating the results of
`git ls-files -u -z` in `unmergedFiles()`. The code here makes the
mistake of assuming that every unmerged file will always have a stage 1
conflict, and this results in conflicts that occur in stage 3 only being
dropped.

This PR simply adjusts this code to ensure that any empty unmergedFile
will always be passed down the channel.

The PR also adds a lot of Trace commands to attempt to help find future
bugs in this code.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-07-29 01:19:55 +02:00
wxiaoguang 124b072f0b
Remove git.Command.Run and git.Command.RunInDir* ()
Follows , , Close , now there are only three `Run..(&RunOpts{})` functions.
 * before: `stdout, err := RunInDir(path)`
 * now: `stdout, _, err := RunStdString(&git.RunOpts{Dir:path})`
2022-04-01 10:55:30 +08:00
Martin Scholz 26718a785a
Change git.cmd to RunWithContext ()
Change all `cmd...Pipeline` commands to `cmd.RunWithContext`.



Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
2022-02-11 13:47:22 +01:00
6543 3043eb36bf
Delete old git.NewCommand() and use it as git.NewCommandContext() () 2022-02-06 20:01:47 +01:00
zeripath f1e85622da
Improve TestPatch to use git read-tree -m and implement git-merge-one-file functionality ()
The current TestPatch conflict code uses a plain git apply which does not properly
account for 3-way merging. However, we can improve things using `git read-tree -m` to
do a three-way merge then follow the algorithm used in merge-one-file. We can also use 
`--patience` and/or `--histogram` to generate a nicer diff for applying patches too.

Fix 
Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-12-19 05:19:25 +01:00