Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-02 03:25:57 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-02 07:59:52 +0300
commite9fe6f262eab9a262100cbd60355b8c0f346ff59 (patch)
treed53aae66667578304f5c2df4062a8d51214de33b /merge.c
parentcb91022c0e6d5e926d009156c1aea7dc137ddefd (diff)
merge: convert empty tree constant to the_hash_algo
To avoid dependency on a particular hash algorithm, convert a use of EMPTY_TREE_SHA1_HEX to use the_hash_algo->empty_tree instead. Since both branches now use oid_to_hex, condense the if statement into a ternary. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge.c')
-rw-r--r--merge.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/merge.c b/merge.c
index f06a4773d4..5186cb6156 100644
--- a/merge.c
+++ b/merge.c
@@ -11,10 +11,7 @@
static const char *merge_argument(struct commit *commit)
{
- if (commit)
- return oid_to_hex(&commit->object.oid);
- else
- return EMPTY_TREE_SHA1_HEX;
+ return oid_to_hex(commit ? &commit->object.oid : the_hash_algo->empty_tree);
}
int index_has_changes(struct strbuf *sb)