OpenQuizz
Une application de gestion des contenus pédagogiques
git.repo.fun Namespace Reference

Functions

def touch (filename)
 
def is_git_dir (d)
 
def find_worktree_git_dir (dotgit)
 
def find_submodule_git_dir (d)
 
def short_to_long (odb, hexsha)
 
def name_to_object (repo, name, return_ref=False)
 
def deref_tag (tag)
 
def to_commit (obj)
 
def rev_parse (repo, rev)
 

Detailed Description

Package with general repository related functions

Function Documentation

◆ deref_tag()

def git.repo.fun.deref_tag (   tag)
Recursively dereference a tag and return the resulting object

◆ find_submodule_git_dir()

def git.repo.fun.find_submodule_git_dir (   d)
Search for a submodule repo.

◆ find_worktree_git_dir()

def git.repo.fun.find_worktree_git_dir (   dotgit)
Search for a gitdir for this worktree.

◆ is_git_dir()

def git.repo.fun.is_git_dir (   d)
This is taken from the git setup.c:is_git_directory
function.

@throws WorkTreeRepositoryUnsupported if it sees a worktree directory. It's quite hacky to do that here,
        but at least clearly indicates that we don't support it.
        There is the unlikely danger to throw if we see directories which just look like a worktree dir,
        but are none.

◆ name_to_object()

def git.repo.fun.name_to_object (   repo,
  name,
  return_ref = False 
)
:return: object specified by the given name, hexshas ( short and long )
    as well as references are supported
:param return_ref: if name specifies a reference, we will return the reference
    instead of the object. Otherwise it will raise BadObject or BadName

◆ rev_parse()

def git.repo.fun.rev_parse (   repo,
  rev 
)
:return: Object at the given revision, either Commit, Tag, Tree or Blob
:param rev: git-rev-parse compatible revision specification as string, please see
    http://www.kernel.org/pub/software/scm/git/docs/git-rev-parse.html
    for details
:raise BadObject: if the given revision could not be found
:raise ValueError: If rev couldn't be parsed
:raise IndexError: If invalid reflog index is specified

◆ short_to_long()

def git.repo.fun.short_to_long (   odb,
  hexsha 
)
:return: long hexadecimal sha1 from the given less-than-40 byte hexsha
    or None if no candidate could be found.
:param hexsha: hexsha with less than 40 byte

◆ to_commit()

def git.repo.fun.to_commit (   obj)
Convert the given object to a commit if possible and return it

◆ touch()

def git.repo.fun.touch (   filename)