From: Catalin Marinas Date: Thu, 10 Nov 2005 14:28:42 +0000 (+0000) Subject: Optimise pick --fold to use git-apply first X-Git-Tag: v0.8~27 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/d218d2f8c234b1cb17616dc98d8e5d670138e124?ds=sidebyside Optimise pick --fold to use git-apply first If "git-diff-tree | git-apply" fails, the command falls back to a three-way merge. Signed-off-by: Catalin Marinas --- diff --git a/stgit/commands/pick.py b/stgit/commands/pick.py index 770d69f..c425945 100644 --- a/stgit/commands/pick.py +++ b/stgit/commands/pick.py @@ -80,7 +80,9 @@ def func(parser, options, args): print 'Folding commit %s...' % commit_id, sys.stdout.flush() - git.merge(bottom, git.get_head(), top) + # try a direct git-apply first + if not git.apply_diff(bottom, top): + git.merge(bottom, git.get_head(), top) print 'done' else: