]> asedeno.scripts.mit.edu Git - git-svn-keywords.git/commitdiff
Detect bare repositories and path in working directory
authorAlejandro R. Sedeño <asedeno@mit.edu>
Tue, 16 Feb 2010 21:32:15 +0000 (16:32 -0500)
committerAlejandro R. Sedeño <asedeno@mit.edu>
Tue, 16 Feb 2010 21:32:15 +0000 (16:32 -0500)
If this looks like a bare repo, bail.
Otherwise, move to the top of the wd before proceeding.

git-svn-keywords.py

index ba6c2a8b70bef165aaac67e61dd40e4bfe2a8039..4abf3b76c6ae97c75e2ede359f5f51c05d1cd461 100755 (executable)
@@ -277,6 +277,12 @@ if __name__ == '__main__':
             print "You are not in a git repository or working directory."
             exit(1)
 
+        if g.bare:
+            print "This appears to be a bare git repository."
+            exit(1)
+
+        os.chdir(g.wd)
+
         CONFIG_PATH = os.path.join(gsk(g), 'conf.ini')
         FILES_PATH = os.path.join(gsk(g), 'files.ini')
         FILEINFO_PATH = os.path.join(gsk(g), 'fileinfo.ini')