summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-08-29 02:25:57 -0400
committerMalf Furious <m@lfurio.us>2017-08-29 02:25:57 -0400
commitcd120958926681c8f2a870f2b0a480e056868a15 (patch)
treee8927eb2f683be8f398b0942a37add9c279ada49
parent2ceeb1baef56a1aa49db4d43fb3160d8a2832f39 (diff)
downloadsystrunk-cd120958926681c8f2a870f2b0a480e056868a15.tar.gz
systrunk-cd120958926681c8f2a870f2b0a480e056868a15.zip
Fix commit to new branch bug
Squeltched "X not a revision" message and now printing "Creating new branch X" instead.
-rw-r--r--commit.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/commit.sh b/commit.sh
index b85ddff..1190715 100644
--- a/commit.sh
+++ b/commit.sh
@@ -67,7 +67,8 @@ function systr_commit
exit 1
fi
- branchcommit=$(systr_repo_resolve_reference "$branch") || branchcommit="$BASE"
+ branchcommit=$(systr_repo_resolve_reference "$branch" 2>/dev/null) || branchcommit="$BASE"
+ systr_repo_resolve_reference "$branch" >/dev/null 2>&1 || echo "Creating new branch $branch"
if [[ "$BASE" != "$branchcommit" ]]; then
echo "Worktree is out-of-date, won't commit"