@@ -992,16 +992,6 @@ static void diagnose_invalid_index_path(int stage,
992992}
993993
994994
995- int get_sha1_with_mode_1 (const char * name , unsigned char * sha1 , unsigned * mode ,
996- int only_to_die , const char * prefix )
997- {
998- struct object_context oc ;
999- int ret ;
1000- ret = get_sha1_with_context_1 (name , sha1 , & oc , only_to_die , prefix );
1001- * mode = oc .mode ;
1002- return ret ;
1003- }
1004-
1005995static char * resolve_relative_path (const char * rel )
1006996{
1007997 if (prefixcmp (rel , "./" ) && prefixcmp (rel , "../" ))
@@ -1019,9 +1009,9 @@ static char *resolve_relative_path(const char *rel)
10191009 rel );
10201010}
10211011
1022- int get_sha1_with_context_1 (const char * name , unsigned char * sha1 ,
1023- struct object_context * oc ,
1024- int only_to_die , const char * prefix )
1012+ static int get_sha1_with_context_1 (const char * name , unsigned char * sha1 ,
1013+ struct object_context * oc ,
1014+ int only_to_die , const char * prefix )
10251015{
10261016 int ret , bracket_depth ;
10271017 int namelen = strlen (name );
@@ -1134,3 +1124,18 @@ int get_sha1_with_context_1(const char *name, unsigned char *sha1,
11341124 }
11351125 return ret ;
11361126}
1127+
1128+ int get_sha1_with_mode_1 (const char * name , unsigned char * sha1 , unsigned * mode ,
1129+ int only_to_die , const char * prefix )
1130+ {
1131+ struct object_context oc ;
1132+ int ret ;
1133+ ret = get_sha1_with_context_1 (name , sha1 , & oc , only_to_die , prefix );
1134+ * mode = oc .mode ;
1135+ return ret ;
1136+ }
1137+
1138+ int get_sha1_with_context (const char * str , unsigned char * sha1 , struct object_context * orc )
1139+ {
1140+ return get_sha1_with_context_1 (str , sha1 , orc , 0 , NULL );
1141+ }
0 commit comments