Thread (2 messages) flat view 2 messages, 2 authors, 2016-08-13
DORMANTno replies

[TopGit PATCH] tg-push: don't accept non-tgish branches to push

From: Bert Wesarg <hidden>
Date: 2016-08-13 23:24:20
Subsystem: the rest · Maintainer: Linus Torvalds

tg push dies if you give it a non-tgish branch:

$ tg push -r push-test master
fatal: Not a valid object name refs/top-bases/master
fatal: ambiguous argument '^{tree}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
fatal: Not a valid object name master:.topdeps

Fix this.

Signed-off-by: Bert Wesarg <redacted>

---
 tg-push.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tg-push.sh b/tg-push.sh
index c813927..1d7a8a7 100644
--- a/tg-push.sh
+++ b/tg-push.sh
@@ -42,7 +42,8 @@ if [ -z "$branches" ]; then
 fi
 
 for name in $branches; do
-	ref_exists "$name" || die "detached HEAD? Can't push $name"
+	ref_exists "refs/top-bases/$name" ||
+		die "not a TopGit-controlled branch: $name"
 done
 
 _listfile="$(mktemp -t tg-push-listfile.XXXXXX)"
-- 
tg: (8ec0303..) bw/push-fixes-2 (depends on: bw/push-fixes)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help