aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/git_browse/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'bn_django/git_browse/views.py')
-rw-r--r--bn_django/git_browse/views.py19
1 files changed, 2 insertions, 17 deletions
diff --git a/bn_django/git_browse/views.py b/bn_django/git_browse/views.py
index f28aa76..ed653df 100644
--- a/bn_django/git_browse/views.py
+++ b/bn_django/git_browse/views.py
@@ -9,11 +9,6 @@ import os, commands
from models import *
try:
- GITBROWSE_BASE = settings.GITBROWSE_BASE+'/'
-except AttributeError:
- GITBROWSE_BASE='/home/'
-
-try:
GITCOMMAND = settings.GITCOMMAND
except AttributeError:
GITCOMMAND='git'
@@ -41,11 +36,9 @@ def view_tree(request, repo, hash=None,branch=None):
(GITPREFIX, heads, tags) = therepo.scan()
if(hash == None):
- head_ref = commands.getoutput('cd ' + GITBROWSE_BASE \
- + therepo.slug +'/.git; cat HEAD')
+ head_ref = commands.getoutput('cd ' + therepo.path + '; cat HEAD')
head_ref = head_ref.split()[1]
- hash = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug \
- +'/.git; cat ' + head_ref)
+ hash = commands.getoutput('cd ' + therepo.path + '; cat ' + head_ref)
tree_ls = commands.getoutput(GITPREFIX + ' ls-tree ' + hash)
tree_objs = list()
@@ -70,9 +63,6 @@ def view_log(request, repo, hash=None):
therepo = get_object_or_404(Repository, slug=repo)
(GITPREFIX, heads, tags) = therepo.scan()
- GITPREFIX = 'cd ' + GITBROWSE_BASE + therepo.slug + '; ' + GITCOMMAND \
- + ' --git-dir=' + GITBROWSE_BASE + therepo.slug + '/.git '
-
logtxt = commands.getoutput(GITPREFIX + ' log | cat')
log_items = logtxt.split('\ncommit ')
if (log_items[0] == ''):
@@ -126,11 +116,6 @@ def view_obj(request, repo, hash, branch=None):
(GITPREFIX, heads, tags) = therepo.scan()
obj_type = commands.getoutput(GITPREFIX + ' cat-file -t ' + hash)
- #if(obj_type == 'tree'):
- # redirect_to('../tree/' + hash);
- #if(obj_type == 'blob'):
- # redirect_to('../blob/' + hash);
-
obj_contents = commands.getoutput(GITPREFIX + ' cat-file -p ' + hash)
obj_size = commands.getoutput(GITPREFIX + ' cat-file -s ' + hash)