Import the remaining utilities.
[utils/utils.git] / ungitar
... / ...
CommitLineData
1#!/bin/bash
2# usage: ungitar foo-dir <foo.gitar
3
4set -e
5trap "echo 'Unexpected error!' 1>&2" ERR
6if ! [ -e "$1" ]; then
7 mkdir "$1"
8fi
9cd "$1"
10
11if [ -e '.git' ]; then
12 echo 'The destination directory is already a git repository!' 1>&2
13 exit 1
14fi
15trap "rm -rf .git" EXIT
16
17ftx .git
18git-read-tree master
19git-checkout-index --all --force