diff options
Diffstat (limited to 'bin/gitify')
-rwxr-xr-x | bin/gitify | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -32,8 +32,7 @@ main() { cd "$1" git init echo 'ref: refs/heads/PROGRAMS/CVTUTF' > .git/HEAD - lastbranch=PROGRAMS/CVTUTF - git commit --allow-empty -m 'initial commit' + lastbranch='' for snapshot in "$top"/dat/pools/snaps/*; do snapname="${snapshot##*/}" @@ -43,9 +42,14 @@ main() { branch=$dirpart newbranch=true - git checkout "$lastbranch" - git checkout -b "$branch" || newbranch=false - git checkout "$branch" + if [[ -n "$lastbranch" ]]; then + git checkout "$lastbranch" + if [[ "$branch" == *.OLD ]]; then + git checkout HEAD^ + fi + git checkout -b "$branch" || newbranch=false + git checkout "$branch" + fi rm -f -- * .metadata.txt cp -- "$snapshot"/* . |