Re: Error pushing new branch: value too great for base (error token is...
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 5, 2015, 17:53 UTC
- Message-ID
- <CAPig+cTXO3699MdqSFVDBcnKcHAT=Mkp=c=r3C8F5nT8tfr6gw@mail.gmail.com>
- In-Reply-To
- <CAGDgvc3Gxn=pKBfYC+yrUhCmL9X6bqjPVwVokF0qPsXmhx_EaQ@mail.gmail.com>
On Wed, Aug 5, 2015 at 1:32 PM, Gaurav Chhabra <varuag.chhabra@gmail.com> wrote:
Show 21 quoted lines
> I had written the following code to check whether a push is for branch deletion: > > #!/bin/bash > > NULL="0000000000000000000000000000000000000000" > if [[ "$new_sha" -eq "$NULL" ]]; then # Line 17 > remote: Stdin: [0000000000000000000000000000000000000000] > [9226289d2416af4cb7365d7aaa5e382bdb3d9a89] [refs/heads/rel-a] > remote: > remote: hooks/pre-receive: line 17: [[: > 9226289d2416af4cb7365d7aaa5e382bdb3d9a89: value too great for base > (error token is "922628 > 9d2416af4cb7365d7aaa5e382bdb3d9a89") > > Although the new branch gets pushed to remote but i'm not sure why i'm > getting this error and how can i fix it. I checked online and i get > few links where folks had similar issue but in each such case, the > error token was 08 or 09. I still tried the suggestion of using "10#" > in front of my $new_sha variable but to no avail. > > Any suggestions?
Yes, try using the string comparison '=' operator rather than the numeric comparison operator '-eq'.
if [[ "$new_sha" = "$NULL" ]]; then