WebKit Bugzilla
Attachment 343273 Details for
Bug 186810
: [style] Fix --git-index option for check-webkit-style command
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add unittest
186810.diff (text/plain), 3.03 KB, created by
Basuke Suzuki
on 2018-06-21 13:55:20 PDT
(
hide
)
Description:
Add unittest
Filename:
MIME Type:
Creator:
Basuke Suzuki
Created:
2018-06-21 13:55:20 PDT
Size:
3.03 KB
patch
obsolete
>diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index ad1ec70158d..c8a50ac6e90 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-21 Basuke Suzuki <Basuke.Suzuki@sony.com> >+ >+ [style] Fix --git-index option for check-webkit-style command >+ https://bugs.webkit.org/show_bug.cgi?id=186810 >+ >+ When --git-index is specified, it should be compared with HEAD, not the origin/master. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitpy/common/checkout/scm/git.py: >+ (Git.create_patch): >+ * Scripts/webkitpy/common/checkout/scm/scm_unittest.py: >+ (test_create_patch_with_git_index): Added. >+ > 2018-06-19 Robin Morisset <rmorisset@apple.com> > > [WSL] Improving the typing rules >diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/Tools/Scripts/webkitpy/common/checkout/scm/git.py >index 8d30ee41eab..f262f1073b6 100644 >--- a/Tools/Scripts/webkitpy/common/checkout/scm/git.py >+++ b/Tools/Scripts/webkitpy/common/checkout/scm/git.py >@@ -338,9 +338,11 @@ class Git(SCM, SVNRepository): > if self._filesystem.exists(order_file): > order = "-O%s" % order_file > >- command = [self.executable_name, 'diff', '--binary', '--no-color', "--no-ext-diff", "--full-index", "--no-renames", order, self.merge_base(git_commit)] >+ command = [self.executable_name, 'diff', '--binary', '--no-color', "--no-ext-diff", "--full-index", "--no-renames", order] > if git_index: > command += ['--cached'] >+ else: >+ command += [self.merge_base(git_commit)] > command += ["--"] > if changed_files: > command += changed_files >diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py >index 2fa58ba0c00..85045645b5e 100644 >--- a/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py >+++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py >@@ -1021,6 +1021,26 @@ class GitTest(SCMTest): > patch = scm.create_patch() > self.assertNotRegexpMatches(patch, r'Subversion Revision:') > >+ def test_create_patch_with_git_index(self): >+ # First change. Committed. >+ write_into_file_at_path('test_file_commit1', 'first cat') >+ run_command(['git', 'add', 'test_file_commit1']) >+ scm = self.tracking_scm >+ scm.commit_locally_with_message('message') >+ >+ # Second change. Staged but not committed. >+ write_into_file_at_path('test_file_commit1', 'second dog') >+ run_command(['git', 'add', 'test_file_commit1']) >+ >+ # Third change. Not even staged. >+ write_into_file_at_path('test_file_commit1', 'third unicorn') >+ >+ patch = scm.create_patch(None, None, True) >+ self.assertRegexpMatches(patch, r'-first cat') >+ self.assertRegexpMatches(patch, r'\+second dog') >+ self.assertNotRegexpMatches(patch, r'third') >+ self.assertNotRegexpMatches(patch, r'unicorn') >+ > def test_orderfile(self): > os.mkdir("Tools") > os.mkdir("Source")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dbates
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186810
:
343082
|
343273
|
343287
|
343300
|
343360