[PATCH 17/21] git p4: avoid shell when mapping users
- From
- Pete Wyckoff <pw@padd.com>
- Date
- Sep 28, 2012, 12:04 UTC
- Message-ID
- <1348833865-6093-18-git-send-email-pw@padd.com>
- In-Reply-To
- <1348833865-6093-1-git-send-email-pw@padd.com>
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> --- git-p4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py index a6806bc..a92d84f 100755 --- a/git-p4.py +++ b/git-p4.py @@ -982,7 +982,8 @@ class P4Submit(Command, P4UserMap): def p4UserForCommit(self,id): # Return the tuple (perforce user,git email) for a given git commit id 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() if not self.emails.has_key(gitEmail): return (None,gitEmail)
-- 1.7.12.1.403.g28165e1