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>
Junio C Hamano committed
Feb 22, 2006 at 03:47 UTC
d27d5b3c5b97ca30dfc5c448dc8cdae914131051
1 file changed
+1
-5
contrib/gitview/gitview
+1
-5
@@ -454,11 +454,7 @@ class GitView:
454
455
self.bt_sha1 = { }
456
ls_remote = re.compile('^(.{40})\trefs/([^^]+)(?:\\^(..))?$');
457
- git_dir = os.getenv("GIT_DIR")
458
- if (git_dir == None):
459
- git_dir = ".git"
460
-
461
- fp = os.popen('git ls-remote ' + git_dir)
457
+ fp = os.popen('git ls-remote "${GIT_DIR-.git}"')
458
while 1:
459
line = string.strip(fp.readline())
460
if line == '':