From cbb56203466fb26ef1dbc4abf12c4bef787c7d93 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Jul 2017 19:52:34 -0400 Subject: allow branches to be created without modifying contents --- bin/gitify | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/gitify b/bin/gitify index 55ddff8..a05ae97 100755 --- a/bin/gitify +++ b/bin/gitify @@ -41,8 +41,9 @@ main() { dirpart="${dirpart//_/\/}" branch=$dirpart + newbranch=true git checkout PROGRAMS/CVTUTF - git checkout -b "$branch" || true + git checkout -b "$branch" || newbranch=false git checkout "$branch" rm -f -- * .metadata.txt @@ -60,7 +61,7 @@ main() { cp "$listingdir/metadata.txt" .metadata.txt fi - if [[ -n "$(git status -s .)" ]]; then + if $newbranch || [[ -n "$(git status -s .)" ]]; then if [[ "$time" = *99 ]]; then msg="Synthesized listing: ${time} ${dirpart}" time="${time%99}00" @@ -72,7 +73,7 @@ main() { git add . export GIT_AUTHOR_DATE=$gitdate export GIT_COMMITTER_DATE=$gitdate - git commit -m "$msg" + git commit --allow-empty -m "$msg" fi done } -- cgit v1.2.3-2-g168b