gitview: ls-remote invocation shellquote safety.

This will allow you to point GIT_DIR at directories with funny names.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-02-22 03:47:20 -08:00
parent 5031985034
commit d27d5b3c5b

View File

@ -454,11 +454,7 @@ class GitView:
self.bt_sha1 = { } self.bt_sha1 = { }
ls_remote = re.compile('^(.{40})\trefs/([^^]+)(?:\\^(..))?$'); ls_remote = re.compile('^(.{40})\trefs/([^^]+)(?:\\^(..))?$');
git_dir = os.getenv("GIT_DIR") fp = os.popen('git ls-remote "${GIT_DIR-.git}"')
if (git_dir == None):
git_dir = ".git"
fp = os.popen('git ls-remote ' + git_dir)
while 1: while 1:
line = string.strip(fp.readline()) line = string.strip(fp.readline())
if line == '': if line == '':