Fossil SCM
Make "fossil import" read the --git options when neither --git nor --svn is given, as the help text says git is the default. Without --git the master branch got an empty name and --import-marks, --export-marks, --rename-master, --use-author and --attribute were refused.
Commit
149cdcff9112680facde6e047e92425e0a62ba8ea8fb8ca819186e18f2e011be
Parent
a7881ab66e45fb4…
1 file changed
+2
-2
+2
-2
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1831,11 +1831,10 @@ | ||
| 1831 | 1831 | char *zPassword; |
| 1832 | 1832 | FILE *pIn; |
| 1833 | 1833 | Stmt q; |
| 1834 | 1834 | int forceFlag = find_option("force", "f", 0)!=0; |
| 1835 | 1835 | int svnFlag = find_option("svn", 0, 0)!=0; |
| 1836 | - int gitFlag = find_option("git", 0, 0)!=0; | |
| 1837 | 1836 | int omitRebuild = find_option("no-rebuild",0,0)!=0; |
| 1838 | 1837 | int omitVacuum = find_option("no-vacuum",0,0)!=0; |
| 1839 | 1838 | const char *zDefaultUser = find_option("admin-user","A",1); |
| 1840 | 1839 | |
| 1841 | 1840 | /* Options common to all input formats */ |
| @@ -1881,10 +1880,11 @@ | ||
| 1881 | 1880 | } |
| 1882 | 1881 | if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){ |
| 1883 | 1882 | gimport.zTrunkName = fossil_strdup(db_main_branch()); |
| 1884 | 1883 | } |
| 1885 | 1884 | |
| 1885 | + find_option("git", 0, 0); | |
| 1886 | 1886 | if( svnFlag ){ |
| 1887 | 1887 | /* Get --svn related options here, so verify_all_options() fails when |
| 1888 | 1888 | * svn-only options are specified with --git |
| 1889 | 1889 | */ |
| 1890 | 1890 | const char *zIgnTree; |
| @@ -1902,11 +1902,11 @@ | ||
| 1902 | 1902 | gsvn.zTrunk = find_option("trunk", 0, 1); |
| 1903 | 1903 | gsvn.zBranches = find_option("branches", 0, 1); |
| 1904 | 1904 | gsvn.zTags = find_option("tags", 0, 1); |
| 1905 | 1905 | gsvn.revFlag = find_option("rev-tags", 0, 0) |
| 1906 | 1906 | || (incrFlag && !find_option("no-rev-tags", 0, 0)); |
| 1907 | - }else if( gitFlag ){ | |
| 1907 | + }else{ | |
| 1908 | 1908 | const char *zGitUser; |
| 1909 | 1909 | markfile_in = find_option("import-marks", 0, 1); |
| 1910 | 1910 | markfile_out = find_option("export-marks", 0, 1); |
| 1911 | 1911 | if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){ |
| 1912 | 1912 | ggit.zMasterName = "master"; |
| 1913 | 1913 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1831,11 +1831,10 @@ | |
| 1831 | char *zPassword; |
| 1832 | FILE *pIn; |
| 1833 | Stmt q; |
| 1834 | int forceFlag = find_option("force", "f", 0)!=0; |
| 1835 | int svnFlag = find_option("svn", 0, 0)!=0; |
| 1836 | int gitFlag = find_option("git", 0, 0)!=0; |
| 1837 | int omitRebuild = find_option("no-rebuild",0,0)!=0; |
| 1838 | int omitVacuum = find_option("no-vacuum",0,0)!=0; |
| 1839 | const char *zDefaultUser = find_option("admin-user","A",1); |
| 1840 | |
| 1841 | /* Options common to all input formats */ |
| @@ -1881,10 +1880,11 @@ | |
| 1881 | } |
| 1882 | if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){ |
| 1883 | gimport.zTrunkName = fossil_strdup(db_main_branch()); |
| 1884 | } |
| 1885 | |
| 1886 | if( svnFlag ){ |
| 1887 | /* Get --svn related options here, so verify_all_options() fails when |
| 1888 | * svn-only options are specified with --git |
| 1889 | */ |
| 1890 | const char *zIgnTree; |
| @@ -1902,11 +1902,11 @@ | |
| 1902 | gsvn.zTrunk = find_option("trunk", 0, 1); |
| 1903 | gsvn.zBranches = find_option("branches", 0, 1); |
| 1904 | gsvn.zTags = find_option("tags", 0, 1); |
| 1905 | gsvn.revFlag = find_option("rev-tags", 0, 0) |
| 1906 | || (incrFlag && !find_option("no-rev-tags", 0, 0)); |
| 1907 | }else if( gitFlag ){ |
| 1908 | const char *zGitUser; |
| 1909 | markfile_in = find_option("import-marks", 0, 1); |
| 1910 | markfile_out = find_option("export-marks", 0, 1); |
| 1911 | if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){ |
| 1912 | ggit.zMasterName = "master"; |
| 1913 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1831,11 +1831,10 @@ | |
| 1831 | char *zPassword; |
| 1832 | FILE *pIn; |
| 1833 | Stmt q; |
| 1834 | int forceFlag = find_option("force", "f", 0)!=0; |
| 1835 | int svnFlag = find_option("svn", 0, 0)!=0; |
| 1836 | int omitRebuild = find_option("no-rebuild",0,0)!=0; |
| 1837 | int omitVacuum = find_option("no-vacuum",0,0)!=0; |
| 1838 | const char *zDefaultUser = find_option("admin-user","A",1); |
| 1839 | |
| 1840 | /* Options common to all input formats */ |
| @@ -1881,10 +1880,11 @@ | |
| 1880 | } |
| 1881 | if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){ |
| 1882 | gimport.zTrunkName = fossil_strdup(db_main_branch()); |
| 1883 | } |
| 1884 | |
| 1885 | find_option("git", 0, 0); |
| 1886 | if( svnFlag ){ |
| 1887 | /* Get --svn related options here, so verify_all_options() fails when |
| 1888 | * svn-only options are specified with --git |
| 1889 | */ |
| 1890 | const char *zIgnTree; |
| @@ -1902,11 +1902,11 @@ | |
| 1902 | gsvn.zTrunk = find_option("trunk", 0, 1); |
| 1903 | gsvn.zBranches = find_option("branches", 0, 1); |
| 1904 | gsvn.zTags = find_option("tags", 0, 1); |
| 1905 | gsvn.revFlag = find_option("rev-tags", 0, 0) |
| 1906 | || (incrFlag && !find_option("no-rev-tags", 0, 0)); |
| 1907 | }else{ |
| 1908 | const char *zGitUser; |
| 1909 | markfile_in = find_option("import-marks", 0, 1); |
| 1910 | markfile_out = find_option("export-marks", 0, 1); |
| 1911 | if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){ |
| 1912 | ggit.zMasterName = "master"; |
| 1913 |