@@ -119,7 +119,7 @@ static void add_branch(const char *key, const char *branchname,
119119 else
120120 strbuf_addf (tmp , "refs/heads/%s:refs/remotes/%s/%s" ,
121121 branchname , remotename , branchname );
122- git_config_set_multivar_or_die (key , tmp -> buf , "^$" , 0 );
122+ git_config_set_multivar (key , tmp -> buf , "^$" , 0 );
123123}
124124
125125static const char mirror_advice [] =
@@ -197,7 +197,7 @@ static int add(int argc, const char **argv)
197197 die (_ ("'%s' is not a valid remote name" ), name );
198198
199199 strbuf_addf (& buf , "remote.%s.url" , name );
200- git_config_set_or_die (buf .buf , url );
200+ git_config_set (buf .buf , url );
201201
202202 if (!mirror || mirror & MIRROR_FETCH ) {
203203 strbuf_reset (& buf );
@@ -213,14 +213,14 @@ static int add(int argc, const char **argv)
213213 if (mirror & MIRROR_PUSH ) {
214214 strbuf_reset (& buf );
215215 strbuf_addf (& buf , "remote.%s.mirror" , name );
216- git_config_set_or_die (buf .buf , "true" );
216+ git_config_set (buf .buf , "true" );
217217 }
218218
219219 if (fetch_tags != TAGS_DEFAULT ) {
220220 strbuf_reset (& buf );
221221 strbuf_addf (& buf , "remote.%s.tagopt" , name );
222- git_config_set_or_die (buf .buf ,
223- fetch_tags == TAGS_SET ? "--tags" : "--no-tags" );
222+ git_config_set (buf .buf ,
223+ fetch_tags == TAGS_SET ? "--tags" : "--no-tags" );
224224 }
225225
226226 if (fetch && fetch_remote (name ))
@@ -586,15 +586,15 @@ static int migrate_file(struct remote *remote)
586586
587587 strbuf_addf (& buf , "remote.%s.url" , remote -> name );
588588 for (i = 0 ; i < remote -> url_nr ; i ++ )
589- git_config_set_multivar_or_die (buf .buf , remote -> url [i ], "^$" , 0 );
589+ git_config_set_multivar (buf .buf , remote -> url [i ], "^$" , 0 );
590590 strbuf_reset (& buf );
591591 strbuf_addf (& buf , "remote.%s.push" , remote -> name );
592592 for (i = 0 ; i < remote -> push_refspec_nr ; i ++ )
593- git_config_set_multivar_or_die (buf .buf , remote -> push_refspec [i ], "^$" , 0 );
593+ git_config_set_multivar (buf .buf , remote -> push_refspec [i ], "^$" , 0 );
594594 strbuf_reset (& buf );
595595 strbuf_addf (& buf , "remote.%s.fetch" , remote -> name );
596596 for (i = 0 ; i < remote -> fetch_refspec_nr ; i ++ )
597- git_config_set_multivar_or_die (buf .buf , remote -> fetch_refspec [i ], "^$" , 0 );
597+ git_config_set_multivar (buf .buf , remote -> fetch_refspec [i ], "^$" , 0 );
598598 if (remote -> origin == REMOTE_REMOTES )
599599 unlink_or_warn (git_path ("remotes/%s" , remote -> name ));
600600 else if (remote -> origin == REMOTE_BRANCHES )
@@ -646,7 +646,7 @@ static int mv(int argc, const char **argv)
646646
647647 strbuf_reset (& buf );
648648 strbuf_addf (& buf , "remote.%s.fetch" , rename .new );
649- git_config_set_multivar_or_die (buf .buf , NULL , NULL , 1 );
649+ git_config_set_multivar (buf .buf , NULL , NULL , 1 );
650650 strbuf_addf (& old_remote_context , ":refs/remotes/%s/" , rename .old );
651651 for (i = 0 ; i < oldremote -> fetch_refspec_nr ; i ++ ) {
652652 char * ptr ;
@@ -666,7 +666,7 @@ static int mv(int argc, const char **argv)
666666 "\tPlease update the configuration manually if necessary." ),
667667 buf2 .buf );
668668
669- git_config_set_multivar_or_die (buf .buf , buf2 .buf , "^$" , 0 );
669+ git_config_set_multivar (buf .buf , buf2 .buf , "^$" , 0 );
670670 }
671671
672672 read_branches ();
@@ -676,7 +676,7 @@ static int mv(int argc, const char **argv)
676676 if (info -> remote_name && !strcmp (info -> remote_name , rename .old )) {
677677 strbuf_reset (& buf );
678678 strbuf_addf (& buf , "branch.%s.remote" , item -> string );
679- git_config_set_or_die (buf .buf , rename .new );
679+ git_config_set (buf .buf , rename .new );
680680 }
681681 }
682682
@@ -774,7 +774,7 @@ static int rm(int argc, const char **argv)
774774 strbuf_reset (& buf );
775775 strbuf_addf (& buf , "branch.%s.%s" ,
776776 item -> string , * k );
777- git_config_set_or_die (buf .buf , NULL );
777+ git_config_set (buf .buf , NULL );
778778 }
779779 }
780780 }
@@ -1556,10 +1556,10 @@ static int set_url(int argc, const char **argv)
15561556 /* Special cases that add new entry. */
15571557 if ((!oldurl && !delete_mode ) || add_mode ) {
15581558 if (add_mode )
1559- git_config_set_multivar_or_die (name_buf .buf , newurl ,
1559+ git_config_set_multivar (name_buf .buf , newurl ,
15601560 "^$" , 0 );
15611561 else
1562- git_config_set_or_die (name_buf .buf , newurl );
1562+ git_config_set (name_buf .buf , newurl );
15631563 strbuf_release (& name_buf );
15641564
15651565 return 0 ;
@@ -1582,9 +1582,9 @@ static int set_url(int argc, const char **argv)
15821582 regfree (& old_regex );
15831583
15841584 if (!delete_mode )
1585- git_config_set_multivar_or_die (name_buf .buf , newurl , oldurl , 0 );
1585+ git_config_set_multivar (name_buf .buf , newurl , oldurl , 0 );
15861586 else
1587- git_config_set_multivar_or_die (name_buf .buf , NULL , oldurl , 1 );
1587+ git_config_set_multivar (name_buf .buf , NULL , oldurl , 1 );
15881588 return 0 ;
15891589}
15901590
0 commit comments