@@ -399,7 +399,7 @@ static curlioerr rpc_ioctl(CURL *handle, int cmd, void *clientp)
399
399
rpc -> pos = 0 ;
400
400
return CURLIOE_OK ;
401
401
}
402
- fprintf ( stderr , "Unable to rewind rpc post data - try increasing http.postBuffer\n " );
402
+ error ( "unable to rewind rpc post data - try increasing http.postBuffer" );
403
403
return CURLIOE_FAILRESTART ;
404
404
405
405
default :
@@ -709,7 +709,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
709
709
free (targets [i ]);
710
710
free (targets );
711
711
712
- return ret ? error ("Fetch failed." ) : 0 ;
712
+ return ret ? error ("fetch failed." ) : 0 ;
713
713
}
714
714
715
715
static int fetch_git (struct discovery * heads ,
@@ -949,7 +949,7 @@ int main(int argc, const char **argv)
949
949
git_extract_argv0_path (argv [0 ]);
950
950
setup_git_directory_gently (& nongit );
951
951
if (argc < 2 ) {
952
- fprintf ( stderr , "Remote needed\n " );
952
+ error ( "remote-curl: usage: git remote-curl <remote> [<url>] " );
953
953
return 1 ;
954
954
}
955
955
@@ -972,16 +972,14 @@ int main(int argc, const char **argv)
972
972
973
973
if (strbuf_getline (& buf , stdin , '\n' ) == EOF ) {
974
974
if (ferror (stdin ))
975
- fprintf (stderr , "Error reading command stream\n" );
976
- else
977
- fprintf (stderr , "Unexpected end of command stream\n" );
975
+ error ("remote-curl: error reading command stream from git" );
978
976
return 1 ;
979
977
}
980
978
if (buf .len == 0 )
981
979
break ;
982
980
if (starts_with (buf .buf , "fetch " )) {
983
981
if (nongit )
984
- die ("Fetch attempted without a local repo" );
982
+ die ("remote-curl: fetch attempted without a local repo" );
985
983
parse_fetch (& buf );
986
984
987
985
} else if (!strcmp (buf .buf , "list" ) || starts_with (buf .buf , "list " )) {
@@ -1017,7 +1015,7 @@ int main(int argc, const char **argv)
1017
1015
printf ("\n" );
1018
1016
fflush (stdout );
1019
1017
} else {
1020
- fprintf ( stderr , "Unknown command '%s'\n " , buf .buf );
1018
+ error ( "remote-curl: unknown command '%s' from git " , buf .buf );
1021
1019
return 1 ;
1022
1020
}
1023
1021
strbuf_reset (& buf );
0 commit comments