string-list: document that string_list_insert() inserts unique strings
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Heiko Voigt committed
Mar 29, 2012 at 09:21 UTC
b8939b2b3abaa99c18bf57251cd2828b89ac38c5
1 file changed
+3
-1
Documentation/technical/api-string-list.txt
+3
-1
@@ -83,7 +83,9 @@ Functions
83
84
Insert a new element to the string_list. The returned pointer can be
85
handy if you want to write something to the `util` pointer of the
86
- string_list_item containing the just added string.
86
+ string_list_item containing the just added string. If the given
87
+ string already exists the insertion will be skipped and the
88
+ pointer to the existing item returned.
89
+
90
Since this function uses xrealloc() (which die()s if it fails) if the
91
list needs to grow, it is safe not to check the pointer. I.e. you may