Merge branch 'as/show-index-uninitialized-hash'
Regression fix for 'show-index' when run outside of a repository. * as/show-index-uninitialized-hash: t5300: add test for 'show-index --object-format' show-index: fix uninitialized hash function
This commit is contained in:
@ -40,6 +40,15 @@ int cmd_show_index(int argc,
|
||||
repo_set_hash_algo(the_repository, hash_algo);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fallback to SHA1 if we are running outside of a repository.
|
||||
*
|
||||
* TODO: Figure out and implement a way to detect the hash algorithm in use by the
|
||||
* the index file passed in and use that instead.
|
||||
*/
|
||||
if (!the_hash_algo)
|
||||
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
|
||||
|
||||
hashsz = the_hash_algo->rawsz;
|
||||
|
||||
if (fread(top_index, 2 * 4, 1, stdin) != 1)
|
||||
|
Reference in New Issue
Block a user