Browse Source

Git.pm: Swap hash_object() parameters

I'm about to introduce get_object() and it will be better for consistency
if the object type always goes first. And writing 'blob' there explicitly
is not much bother.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Petr Baudis 19 years ago committed by Junio C Hamano
parent
commit
24c4b71436
  1. 8
      perl/Git.pm
  2. 4
      perl/Git.xs

8
perl/Git.pm

@ -485,13 +485,13 @@ sub wc_chdir { @@ -485,13 +485,13 @@ sub wc_chdir {
}


=item hash_object ( FILENAME [, TYPE ] )
=item hash_object ( TYPE, FILENAME )

=item hash_object ( FILEHANDLE [, TYPE ] )
=item hash_object ( TYPE, FILEHANDLE )

Compute the SHA1 object id of the given C<FILENAME> (or data waiting in
C<FILEHANDLE>) considering it is of the C<TYPE> object type (C<blob>
(default), C<commit>, C<tree>).
C<FILEHANDLE>) considering it is of the C<TYPE> object type (C<blob>,
C<commit>, C<tree>).

In case of C<FILEHANDLE> passed instead of file name, all the data
available are read and hashed, and the filehandle is automatically

4
perl/Git.xs

@ -104,9 +104,9 @@ CODE: @@ -104,9 +104,9 @@ CODE:
}

char *
xs_hash_object(file, type = "blob")
SV *file;
xs_hash_object(type, file)
char *type;
SV *file;
CODE:
{
unsigned char sha1[20];

Loading…
Cancel
Save