use subprocess instead of system-call

Instead of using a system-call to fetch
the current HEAD commit id, use a subprocess.