push: test the checks preventing pushing orphaness to a server
This is introduce a simple example, more are coming. See inline documentation
for details.
#!/usr/bin/env pythonfrom __future__ import absolute_import, print_functionimport errnoimport osimport sysfor f in sys.argv[1:]: try: print(f, '->', os.readlink(f)) except OSError as err: if err.errno != errno.EINVAL: raise print(f, '->', f, 'not a symlink')sys.exit(0)