Fossil SCM

Don't discard the current remote if there is a problem in parsing the new remote. For example, if the port is greater than 65535.

andybradford 2026-11-23 19:08 UTC small-fixes
Commit 1c87d418d93440e199403f368ef73c6353a3f82e8f093c4d2a28b851f8586587
1 file changed +2
+2
--- src/sync.c
+++ src/sync.c
@@ -876,15 +876,17 @@
876876
|| sqlite3_strlike("https://%",zArg,0)==0
877877
|| sqlite3_strlike("ssh:%",zArg,0)==0
878878
|| sqlite3_strlike("file:%",zArg,0)==0
879879
|| db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg)
880880
){
881
+ db_begin_transaction();
881882
db_unset("last-sync-url", 0);
882883
db_unset("last-sync-pw", 0);
883884
url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW|
884885
URL_USE_CONFIG|URL_ASK_REMEMBER_PW);
885886
url_remember();
887
+ db_commit_transaction();
886888
return;
887889
}
888890
fossil_fatal("unknown command \"%s\" - should be a URL or one of: "
889891
"add delete hyperlink list off scrub", zArg);
890892
}
891893
--- src/sync.c
+++ src/sync.c
@@ -876,15 +876,17 @@
876 || sqlite3_strlike("https://%",zArg,0)==0
877 || sqlite3_strlike("ssh:%",zArg,0)==0
878 || sqlite3_strlike("file:%",zArg,0)==0
879 || db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg)
880 ){
 
881 db_unset("last-sync-url", 0);
882 db_unset("last-sync-pw", 0);
883 url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW|
884 URL_USE_CONFIG|URL_ASK_REMEMBER_PW);
885 url_remember();
 
886 return;
887 }
888 fossil_fatal("unknown command \"%s\" - should be a URL or one of: "
889 "add delete hyperlink list off scrub", zArg);
890 }
891
--- src/sync.c
+++ src/sync.c
@@ -876,15 +876,17 @@
876 || sqlite3_strlike("https://%",zArg,0)==0
877 || sqlite3_strlike("ssh:%",zArg,0)==0
878 || sqlite3_strlike("file:%",zArg,0)==0
879 || db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg)
880 ){
881 db_begin_transaction();
882 db_unset("last-sync-url", 0);
883 db_unset("last-sync-pw", 0);
884 url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW|
885 URL_USE_CONFIG|URL_ASK_REMEMBER_PW);
886 url_remember();
887 db_commit_transaction();
888 return;
889 }
890 fossil_fatal("unknown command \"%s\" - should be a URL or one of: "
891 "add delete hyperlink list off scrub", zArg);
892 }
893

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button