@@ -1520,8 +1520,7 @@ static int blob_content_to_file(
1520
1520
int fd ;
1521
1521
int error = 0 ;
1522
1522
1523
- if (hint_path == NULL )
1524
- hint_path = path ;
1523
+ GIT_ASSERT (hint_path != NULL );
1525
1524
1526
1525
if ((error = mkpath2file (data , path , data -> opts .dir_mode )) < 0 )
1527
1526
return error ;
@@ -1789,7 +1788,7 @@ static int checkout_blob(
1789
1788
}
1790
1789
1791
1790
error = checkout_write_content (
1792
- data , & file -> id , fullpath -> ptr , NULL , file -> mode , & st );
1791
+ data , & file -> id , fullpath -> ptr , file -> path , file -> mode , & st );
1793
1792
1794
1793
/* update the index unless prevented */
1795
1794
if (!error && (data -> strategy & GIT_CHECKOUT_DONT_UPDATE_INDEX ) == 0 )
@@ -1975,7 +1974,7 @@ static int checkout_write_entry(
1975
1974
checkout_conflictdata * conflict ,
1976
1975
const git_index_entry * side )
1977
1976
{
1978
- const char * hint_path = NULL , * suffix ;
1977
+ const char * hint_path , * suffix ;
1979
1978
git_buf * fullpath ;
1980
1979
struct stat st ;
1981
1980
int error ;
@@ -1998,10 +1997,10 @@ static int checkout_write_entry(
1998
1997
1999
1998
if (checkout_path_suffixed (fullpath , suffix ) < 0 )
2000
1999
return -1 ;
2001
-
2002
- hint_path = side -> path ;
2003
2000
}
2004
2001
2002
+ hint_path = side -> path ;
2003
+
2005
2004
if ((data -> strategy & GIT_CHECKOUT_UPDATE_ONLY ) != 0 &&
2006
2005
(error = checkout_safe_for_update_only (data , fullpath -> ptr , side -> mode )) <= 0 )
2007
2006
return error ;
@@ -2118,7 +2117,7 @@ static int checkout_write_merge(
2118
2117
filter_session .temp_buf = & data -> tmp ;
2119
2118
2120
2119
if ((error = git_filter_list__load (
2121
- & fl , data -> repo , NULL , git_buf_cstr ( & path_workdir ) ,
2120
+ & fl , data -> repo , NULL , result . path ,
2122
2121
GIT_FILTER_TO_WORKTREE , & filter_session )) < 0 ||
2123
2122
(error = git_filter_list__convert_buf (& out_data , fl , & in_data )) < 0 )
2124
2123
goto done ;
0 commit comments