File tree Expand file tree Collapse file tree 5 files changed +10
-11
lines changed Expand file tree Collapse file tree 5 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ PyDoc_STRVAR(Object_type_str__doc__,
126
126
PyObject *
127
127
Object_type_str__get__ (Object * self )
128
128
{
129
- return to_path (git_object_type2string (Object__type (self )));
129
+ return PyUnicode_DecodeFSDefault (git_object_type2string (Object__type (self )));
130
130
}
131
131
132
132
PyDoc_STRVAR (Object__pointer__doc__ , "Get the object's pointer. For internal use only." );
@@ -146,7 +146,7 @@ Object_name__get__(Object *self)
146
146
if (self -> entry == NULL )
147
147
Py_RETURN_NONE ;
148
148
149
- return to_path (git_tree_entry_name (self -> entry ));
149
+ return PyUnicode_DecodeFSDefault (git_tree_entry_name (self -> entry ));
150
150
}
151
151
152
152
PyDoc_STRVAR (Object_raw_name__doc__ , "Name (bytes)." );
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ discover_repository(PyObject *self, PyObject *args)
130
130
if (err < 0 )
131
131
return Error_set_str (err , path );
132
132
133
- py_repo_path = to_path (repo_path .ptr );
133
+ py_repo_path = PyUnicode_DecodeFSDefault (repo_path .ptr );
134
134
git_buf_dispose (& repo_path );
135
135
136
136
return py_repo_path ;
Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ Reference_target__get__(Reference *self)
297
297
if (ret != NULL )
298
298
return ret ;
299
299
if (c_name != NULL )
300
- return to_path (c_name );
300
+ return PyUnicode_DecodeFSDefault (c_name );
301
301
return NULL ;
302
302
}
303
303
@@ -392,7 +392,7 @@ PyObject *
392
392
Reference_name__get__ (Reference * self )
393
393
{
394
394
CHECK_REFERENCE (self );
395
- return to_path (git_reference_name (self -> reference ));
395
+ return PyUnicode_DecodeFSDefault (git_reference_name (self -> reference ));
396
396
}
397
397
398
398
PyDoc_STRVAR (Reference_raw_name__doc__ , "The full name of the reference (Bytes)." );
@@ -411,7 +411,7 @@ PyObject *
411
411
Reference_shorthand__get__ (Reference * self )
412
412
{
413
413
CHECK_REFERENCE (self );
414
- return to_path (git_reference_shorthand (self -> reference ));
414
+ return PyUnicode_DecodeFSDefault (git_reference_shorthand (self -> reference ));
415
415
}
416
416
417
417
PyDoc_STRVAR (Reference_raw_shorthand__doc__ ,
Original file line number Diff line number Diff line change @@ -466,7 +466,7 @@ Repository_path__get__(Repository *self, void *closure)
466
466
if (c_path == NULL )
467
467
Py_RETURN_NONE ;
468
468
469
- return to_path (c_path );
469
+ return PyUnicode_DecodeFSDefault (c_path );
470
470
}
471
471
472
472
@@ -483,7 +483,7 @@ Repository_workdir__get__(Repository *self, void *closure)
483
483
if (c_path == NULL )
484
484
Py_RETURN_NONE ;
485
485
486
- return to_path (c_path );
486
+ return PyUnicode_DecodeFSDefault (c_path );
487
487
}
488
488
489
489
int
@@ -1274,7 +1274,7 @@ Repository_create_branch(Repository *self, PyObject *args)
1274
1274
1275
1275
static PyObject *
1276
1276
to_path_f (const char * x ) {
1277
- return to_path (x );
1277
+ return PyUnicode_DecodeFSDefault (x );
1278
1278
}
1279
1279
1280
1280
PyDoc_STRVAR (Repository_raw_listall_references__doc__ ,
@@ -2171,7 +2171,7 @@ Repository_list_worktrees(Repository *self, PyObject *args)
2171
2171
2172
2172
/* Fill it */
2173
2173
for (index = 0 ; index < c_result .count ; index ++ ) {
2174
- py_string = to_path (c_result .strings [index ]);
2174
+ py_string = PyUnicode_DecodeFSDefault (c_result .strings [index ]);
2175
2175
if (py_string == NULL ) {
2176
2176
Py_CLEAR (py_result );
2177
2177
goto out ;
Original file line number Diff line number Diff line change 43
43
#define Py_FileSystemDefaultEncodeErrors "surrogateescape"
44
44
#endif
45
45
46
- #define to_path (x ) to_unicode(x, Py_FileSystemDefaultEncoding, "strict")
47
46
#define to_encoding (x ) PyUnicode_DecodeASCII(x, strlen(x), "strict")
48
47
49
48
You can’t perform that action at this time.
0 commit comments