git p4: avoid shell when mapping users

The extra quoting and double-% are unneeded, just to work
around the shell.  Instead, avoid the shell indirection.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Pete Wyckoff 2013-01-26 22:11:20 -05:00 коммит произвёл Junio C Hamano
Родитель d20f0f8e28
Коммит 9bf2885510
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -1050,7 +1050,8 @@ class P4Submit(Command, P4UserMap):
def p4UserForCommit(self,id): def p4UserForCommit(self,id):
# Return the tuple (perforce user,git email) for a given git commit id # Return the tuple (perforce user,git email) for a given git commit id
self.getUserMapFromPerforceServer() self.getUserMapFromPerforceServer()
gitEmail = read_pipe("git log --max-count=1 --format='%%ae' %s" % id) gitEmail = read_pipe(["git", "log", "--max-count=1",
"--format=%ae", id])
gitEmail = gitEmail.strip() gitEmail = gitEmail.strip()
if not self.emails.has_key(gitEmail): if not self.emails.has_key(gitEmail):
return (None,gitEmail) return (None,gitEmail)