From 13502e0fd3a7db0a94e766170465f452428e49ef Mon Sep 17 00:00:00 2001 From: "bauerb@chromium.org" Date: Thu, 18 Feb 2016 10:18:29 +0000 Subject: [PATCH] Use %B format instead of %s\n\n%b to get the raw commit message from a hash. \n doesn't work on Windows, and %B is shorter anyway. BUG=586344 Review URL: https://codereview.chromium.org/1705193003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298845 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 2 +- tests/git_cl_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git_cl.py b/git_cl.py index 92c6cce5b..3023213dd 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2021,7 +2021,7 @@ def GerritUpload(options, args, cl, change): if options.squash: # Try to get the message from a previous upload. shadow_branch = 'refs/heads/git_cl_uploads/' + cl.GetBranch() - message = RunGitSilent(['show', '--format=%s\n\n%b', '-s', shadow_branch]) + message = RunGitSilent(['show', '--format=%B', '-s', shadow_branch]) if not message: if not options.force: change_desc.prompt() diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index 53815f64c..4015bb32b 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -602,7 +602,7 @@ class TestGitCl(TestCase): if squash: ref_to_push = 'abcdef0123456789' calls += [ - ((['git', 'show', '--format=%s\n\n%b', '-s', + ((['git', 'show', '--format=%B', '-s', 'refs/heads/git_cl_uploads/master'],), (description, 0)), ((['git', 'config', 'branch.master.merge'],),