• Michael Shigorin's avatar
    git usage refactoring · c4311108
    Michael Shigorin authored
    There were heaps of "if type -t git" there already;
    it wasn't an unintentional mishap but rather a moderate
    copy-paste to get the use cases, and now these seem to
    have essentially settled.
    
    So time to scrap some dups.
    
    NB: the scripts in the generated profile can't rely on
    the contents of the metaprofile (these need to be able
    to work in standalone case either), so a bit of crap
    still lurks there.
    c4311108
mp-showref 219 Bytes
#!/bin/sh
# report on git repo in the current directory

if type -t git >&/dev/null; then
	if pushd "$1" >/dev/null && [ -d .git ]; then
		git show-ref --head -ds -- HEAD
		git status -s
		echo
		popd >/dev/null
	fi
fi