threads / patch / 19523

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

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

## tl;dr

2 messages between May 26, 2009 and May 27, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Bert Wesarg· May 26, 2009, 21:46 UTC · lore

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

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 <bert.wesarg@googlemail.com>
---
 tg-push.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to tg-push.sh +2 −1
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)
Uwe Kleine-König· May 27, 2009, 07:23 UTC · re: Bert Wesarg · lore
Hi Bert,
On Tue, May 26, 2009 at 11:46:22PM +0200, Bert Wesarg wrote:
Show 9 quoted lines
> 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.
Why not just make it work instead of dying?

Best regards Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

← back to recent threads