[sysadmin-bin: 110/168] Make get_module_name() work for clones/checkouts



commit d22f8cc68143e9c564359f3077817babe8b11c5c
Author: Olav Vitters <olav bkor dhs org>
Date:   Thu Jun 11 20:21:58 2009 +0200

    Make get_module_name() work for clones/checkouts

 git.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/git.py b/git.py
index 8e087ab..2117f82 100644
--- a/git.py
+++ b/git.py
@@ -183,6 +183,8 @@ def get_module_name():
 
     # Use the directory name with .git stripped as a short identifier
     absdir = os.path.abspath(git_dir)
+    if absdir.endswith(os.sep + '.git'):
+        absdir = os.path.dirname(absdir)
     projectshort = os.path.basename(absdir)
     if projectshort.endswith(".git"):
         projectshort = projectshort[:-4]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]