pegleg/src/bin/pegleg/pegleg/engine
Felipe Monteiro d16432f246 git: Use currently checked out ref when none supplied
This patch set adds logic to examine the currently checked out
reference in a repository if ref=None is passed to git.git_handler.

This makes it convenient to simply reuse the revision that is
currently checked out without having to re-supply it. Note that
ref is still a required parameter so providing None will have
to be done explicitly.

Defaults for ref='master' have been changed to ref=None.
Turns out the GitPython library has logic to use the
repo's Git config's fetch refspec by default [0],
which means that by default 'master' will be checked out
for many repositories.

Also adds a ``is_repository`` function to ``git`` module to
more robustly check whether a directory is a repo.

Unit tests and doc strings are updated as well.

[0] a8591a094a/git/remote.py (L779)

Change-Id: Ib1736eb20a51996cf03fa7f6187f078b39595267
2018-08-09 22:03:35 +01:00
..
util git: Use currently checked out ref when none supplied 2018-08-09 22:03:35 +01:00
__init__.py Add Apache copyright to all Python files 2018-04-05 09:13:26 -04:00
errorcodes.py Add Apache copyright to all Python files 2018-04-05 09:13:26 -04:00
exceptions.py git: Raise exception on ref checkout from dirty repo 2018-07-24 18:58:09 +00:00
lint.py Perform validations on site documents as part of "collect" command 2018-06-11 10:06:50 -04:00
site.py Fix --save-location bugs for collect command 2018-08-01 16:14:12 +01:00
stub.py Add Apache copyright to all Python files 2018-04-05 09:13:26 -04:00