Jeff Locke allowed just two hits over seven innings and the Pittsburgh Pirates edged the Los Angeles Dodgers 3-0 on Friday night.