@@ -134,13 +134,13 @@ static void handle_property(const struct strbuf *key_buf,
134134 die ("invalid dump: sets type twice" );
135135 }
136136 if (!val ) {
137- node_ctx .type = REPO_MODE_BLB ;
137+ node_ctx .type = S_IFREG | 0644 ;
138138 return ;
139139 }
140140 * type_set = 1 ;
141141 node_ctx .type = keylen == strlen ("svn:executable" ) ?
142- REPO_MODE_EXE :
143- REPO_MODE_LNK ;
142+ ( S_IFREG | 0755 ) :
143+ S_IFLNK ;
144144 }
145145}
146146
@@ -219,7 +219,7 @@ static void handle_node(void)
219219 */
220220 static const char * const empty_blob = "::empty::" ;
221221 const char * old_data = NULL ;
222- uint32_t old_mode = REPO_MODE_BLB ;
222+ uint32_t old_mode = S_IFREG | 0644 ;
223223
224224 if (node_ctx .action == NODEACT_DELETE ) {
225225 if (have_text || have_props || node_ctx .srcRev )
@@ -237,27 +237,27 @@ static void handle_node(void)
237237 if (node_ctx .action == NODEACT_ADD )
238238 node_ctx .action = NODEACT_CHANGE ;
239239 }
240- if (have_text && type == REPO_MODE_DIR )
240+ if (have_text && type == S_IFDIR )
241241 die ("invalid dump: directories cannot have text attached" );
242242
243243 /*
244244 * Find old content (old_data) and decide on the new mode.
245245 */
246246 if (node_ctx .action == NODEACT_CHANGE && !* node_ctx .dst .buf ) {
247- if (type != REPO_MODE_DIR )
247+ if (type != S_IFDIR )
248248 die ("invalid dump: root of tree is not a regular file" );
249249 old_data = NULL ;
250250 } else if (node_ctx .action == NODEACT_CHANGE ) {
251251 uint32_t mode ;
252252 old_data = svn_repo_read_path (node_ctx .dst .buf , & mode );
253- if (mode == REPO_MODE_DIR && type != REPO_MODE_DIR )
253+ if (mode == S_IFDIR && type != S_IFDIR )
254254 die ("invalid dump: cannot modify a directory into a file" );
255- if (mode != REPO_MODE_DIR && type == REPO_MODE_DIR )
255+ if (mode != S_IFDIR && type == S_IFDIR )
256256 die ("invalid dump: cannot modify a file into a directory" );
257257 node_ctx .type = mode ;
258258 old_mode = mode ;
259259 } else if (node_ctx .action == NODEACT_ADD ) {
260- if (type == REPO_MODE_DIR )
260+ if (type == S_IFDIR )
261261 old_data = NULL ;
262262 else if (have_text )
263263 old_data = empty_blob ;
@@ -280,7 +280,7 @@ static void handle_node(void)
280280 /*
281281 * Save the result.
282282 */
283- if (type == REPO_MODE_DIR ) /* directories are not tracked. */
283+ if (type == S_IFDIR ) /* directories are not tracked. */
284284 return ;
285285 assert (old_data );
286286 if (old_data == empty_blob )
@@ -385,9 +385,9 @@ void svndump_read(const char *url, const char *local_ref, const char *notes_ref)
385385 continue ;
386386 strbuf_addf (& rev_ctx .note , "%s\n" , t );
387387 if (!strcmp (val , "dir" ))
388- node_ctx .type = REPO_MODE_DIR ;
388+ node_ctx .type = S_IFDIR ;
389389 else if (!strcmp (val , "file" ))
390- node_ctx .type = REPO_MODE_BLB ;
390+ node_ctx .type = S_IFREG | 0644 ;
391391 else
392392 fprintf (stderr , "Unknown node-kind: %s\n" , val );
393393 break ;
0 commit comments