@@ -1042,10 +1042,29 @@ int SvnRevision::fetchIgnoreProps(QString *ignore, apr_pool_t *pool, const char
10421042 SVN_ERR (svn_fs_node_prop (&prop, fs_root, key, " svn:ignore" , pool));
10431043 if (prop) {
10441044 *ignore = QString (prop->data );
1045+ // remove patterns with slashes or backslashes,
1046+ // they didn't match anything in Subversion but would in Git eventually
1047+ ignore->remove (QRegExp (" ^[^\\ r\\ n]*[\\\\ /][^\\ r\\ n]*(?:[\\ r\\ n]|$)|[\\ r\\ n][^\\ r\\ n]*[\\\\ /][^\\ r\\ n]*(?=[\\ r\\ n]|$)" ));
1048+ // add a slash in front to have the same meaning in Git of only working on the direct children
1049+ ignore->replace (QRegExp (" (^|[\\ r\\ n])\\ s*(?![\\ r\\ n]|$)" ), " \\ 1/" );
10451050 } else {
10461051 *ignore = QString ();
10471052 }
10481053
1054+ // Get svn:global-ignores
1055+ prop = NULL ;
1056+ SVN_ERR (svn_fs_node_prop (&prop, fs_root, key, " svn:global-ignores" , pool));
1057+ if (prop) {
1058+ QString global_ignore = QString (prop->data );
1059+ // remove patterns with slashes or backslashes,
1060+ // they didn't match anything in Subversion but would in Git eventually
1061+ global_ignore.remove (QRegExp (" ^[^\\ r\\ n]*[\\\\ /][^\\ r\\ n]*(?:[\\ r\\ n]|$)|[\\ r\\ n][^\\ r\\ n]*[\\\\ /][^\\ r\\ n]*(?=[\\ r\\ n]|$)" ));
1062+ ignore->append (global_ignore);
1063+ }
1064+
1065+ // replace multiple asterisks Subversion meaning by Git meaning
1066+ ignore->replace (QRegExp (" \\ *+" ), " *" );
1067+
10491068 return EXIT_SUCCESS;
10501069}
10511070
@@ -1059,7 +1078,7 @@ int SvnRevision::fetchUnknownProps(apr_pool_t *pool, const char *key, svn_fs_roo
10591078 const void *propKey;
10601079 for (hi = apr_hash_first (pool, table); hi; hi = apr_hash_next (hi)) {
10611080 apr_hash_this (hi, &propKey, NULL , &propVal);
1062- if (strcmp ((char *)propKey, " svn:ignore" )!=0 && strcmp ((char *)propKey, " svn:mergeinfo" ) !=0 ) {
1081+ if (strcmp ((char *)propKey, " svn:ignore" )!=0 && strcmp ((char *)propKey, " svn:global-ignores " )!= 0 && strcmp (( char *)propKey, " svn: mergeinfo" ) !=0 ) {
10631082 qWarning () << " WARN: Unknown svn-property" << (char *)propKey << " set to" << ((svn_string_t *)propVal)->data << " for" << key;
10641083 }
10651084 }
0 commit comments