From f6fb39d53e854993915264b4613bc9f9de17a059 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Jul 2017 19:57:30 -0400 Subject: better logic for which branch should be the parent when creating a branch --- bin/gitify | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/gitify b/bin/gitify index a05ae97..80f85af 100755 --- a/bin/gitify +++ b/bin/gitify @@ -32,6 +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' for snapshot in "$top"/dat/pools/snaps/*; do @@ -42,7 +43,7 @@ main() { branch=$dirpart newbranch=true - git checkout PROGRAMS/CVTUTF + git checkout "$lastbranch" git checkout -b "$branch" || newbranch=false git checkout "$branch" @@ -74,6 +75,9 @@ main() { export GIT_AUTHOR_DATE=$gitdate export GIT_COMMITTER_DATE=$gitdate git commit --allow-empty -m "$msg" + if [[ "$branch" != *.OLD ]]; then + lastbranch="$branch" + fi fi done } -- cgit v1.2.3-54-g00ecf