Message ID | 20210916113516.76445-2-bagasdotme@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | git-request-pull i18n | expand |
On 16/09/21 13:35, Bagas Sanjaya wrote: > In order for waring message "Are you sure you pushed 'remote or HEAD' ^^^^^^ warning Otherwise, Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> > there?" to be translatable, replace ${remote:-HEAD} (variable access > with defaults) in the message by referring it as $remote_or_head. > > Cc: Ryan Anderson <ryan@michonline.com> > Cc: pbonzini@redhat.com > Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> > --- > git-request-pull.sh | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/git-request-pull.sh b/git-request-pull.sh > index 2d0e44656c..9e1d2be9eb 100755 > --- a/git-request-pull.sh > +++ b/git-request-pull.sh > @@ -116,15 +116,17 @@ set fnord $(git ls-remote "$url" | @@PERL@@ -e "$find_matching_ref" "${remote:-H > remote_sha1=$2 > ref=$3 > > +remote_or_head=${remote:-HEAD} > + > if test -z "$ref" > then > echo "warn: No match for commit $headrev found at $url" >&2 > - echo "warn: Are you sure you pushed '${remote:-HEAD}' there?" >&2 > + echo "warn: Are you sure you pushed '$remote_or_head' there?" >&2 > status=1 > elif test "$local_sha1" != "$remote_sha1" > then > echo "warn: $head found at $url but points to a different object" >&2 > - echo "warn: Are you sure you pushed '${remote:-HEAD}' there?" >&2 > + echo "warn: Are you sure you pushed '$remote_or_head' there?" >&2 > status=1 > fi > >
diff --git a/git-request-pull.sh b/git-request-pull.sh index 2d0e44656c..9e1d2be9eb 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -116,15 +116,17 @@ set fnord $(git ls-remote "$url" | @@PERL@@ -e "$find_matching_ref" "${remote:-H remote_sha1=$2 ref=$3 +remote_or_head=${remote:-HEAD} + if test -z "$ref" then echo "warn: No match for commit $headrev found at $url" >&2 - echo "warn: Are you sure you pushed '${remote:-HEAD}' there?" >&2 + echo "warn: Are you sure you pushed '$remote_or_head' there?" >&2 status=1 elif test "$local_sha1" != "$remote_sha1" then echo "warn: $head found at $url but points to a different object" >&2 - echo "warn: Are you sure you pushed '${remote:-HEAD}' there?" >&2 + echo "warn: Are you sure you pushed '$remote_or_head' there?" >&2 status=1 fi
In order for waring message "Are you sure you pushed 'remote or HEAD' there?" to be translatable, replace ${remote:-HEAD} (variable access with defaults) in the message by referring it as $remote_or_head. Cc: Ryan Anderson <ryan@michonline.com> Cc: pbonzini@redhat.com Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> --- git-request-pull.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)