summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/gitify14
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/gitify b/bin/gitify
index d8ce9b0..2c73bcd 100755
--- a/bin/gitify
+++ b/bin/gitify
@@ -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"/* .