Get rid of the duplicated getenv('GIT_MERGE_VERBOSITY') calls with the same
constant string argument. This makes code more readable and prevents typo in
the further development.
Signed-off-by: Andrey Okoshkin <a.okosh...@samsung.com>
Reviewed-by: Stefan Beller <sbel...@google.com>
t the end
> user made via the environment as the one we checked earlier), and I
> can understand that it feels a bit redundant and ugly.
Yes, you absolutely right.
I believe this patch makes code more beautiful :-)
>>> Signed-off-by: Andrey Okoshkin <a.okosh...@samsung.com>
()
as these environment related functions could modify the string pointer returned
by the initial getenv() call.
Signed-off-by: Andrey Okoshkin <a.okosh...@samsung.com>
Reviewed-by: Stefan Beller <sbel...@google.com>
---
Added 'reviewed-by' field.
merge-recursive.c | 7 ---
1 fil
Add lstat() error handling not only for ENOENT case.
Otherwise uninitialised 'struct stat st' variable is used later in case of
lstat() non-ENOENT failure which leads to processing of rubbish values of
file mode ('S_ISLNK(st.st_mode)' check) or size ('xsize_t(st.st_size)').
Signed-off-by: Andrey
()
as these environment related functions could modify the string pointer returned
by the initial getenv() call.
Signed-off-by: Andrey Okoshkin <a.okosh...@samsung.com>
---
I tried to rework the commit message.
merge-recursive.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff
Thanks, Eric, indeed it's better to change the commit message.
25.10.2017 14:53, Eric Sunshine wrote:
> On Wed, Oct 25, 2017 at 7:39 AM, Andrey Okoshkin <a.okosh...@samsung.com>
> wrote:
>> Check 'GIT_MERGE_VERBOSITY' environment variable only once in
>> init_merge_opt
-by: Andrey Okoshkin <a.okosh...@samsung.com>
Reviewed-by: Stefan Beller <sbel...@google.com>
---
Changes since the previous patch:
* no actions are taken between the merge_verbosity assignment and check.
merge-recursive.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff -
;>>> On Tue, Oct 24, 2017 at 8:27 AM, Andrey Okoshkin <a.okosh...@samsung.com>
>>>> wrote:
>>>>> Add check of 'GIT_MERGE_VERBOSITY' environment variable only once in
>>>>> init_merge_options().
>>>>> Consequential call of ge
e/maintainable when presenting this part of the code
> to the user.)
>
> With or without this change:
> Reviewed-by: Stefan Beller <sbel...@google.com>
Yes, in current situation it's more for readability. And I'll make the usage
of merge_verbosity just after the assignment.
--
Best regards,
Andrey Okoshkin
t regards,
Andrey Okoshkin
as getenv() is not thread-safe.
Signed-off-by: Andrey Okoshkin <a.okosh...@samsung.com>
---
merge-recursive.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 1494ffdb8..eaac98145 100644
--- a/merge-recursive.c
+++ b
Add usage of xmalloc() instead of malloc() in add_to_trie() as xmalloc wraps
and checks memory allocation result.
Signed-off-by: Andrey Okoshkin <a.okosh...@samsung.com>
---
Hello,
I'm not sure but it looks like there is a missing check of the malloc result.
memcpy() may crash with SIGSE
Add check of the resolved HEAD reference while printing of a commit summary.
resolve_ref_unsafe() may return NULL pointer if underlying calls of lstat() or
open() fail in files_read_raw_ref().
Such situation can be caused by race: file becomes inaccessible to this moment.
Signed-off-by: Andrey
Add check of the resolved HEAD reference while printing of a commit summary.
resolve_ref_unsafe() may return NULL pointer if underlying calls of lstat() or
open() fail in files_read_raw_ref().
Such situation can be caused by race: file becomes inaccessible to this moment.
Signed-off-by: Andrey
19.10.2017 20:44, Jeff King wrote:
On Thu, Oct 19, 2017 at 12:36:50PM +0300, Andrey Okoshkin wrote:
Thanks, this looks good to me. One other possible minor improvement:
head = resolve_ref_unsafe("HEAD", 0, junk_oid.hash, NULL);
+ if (!head)
+ die
-by: Andrey Okoshkin <a.okosh...@samsung.com>
---
Thank you for your review.
Changes since the previous patch:
* BUG is replaced with die, message;
* Message is changed.
builtin/commit.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/builtin/commit.c b/builtin/commit.c
index 1a0da71a4..cc2
now how much trouble it is
worth going to for that. It's buried behind a ref_transaction, and I
don't think builtin/commit.c ever sees the real name (though maybe it
would be a good feature of the transaction to record the destinations of
any symrefs we updated).
--
Best regards,
Andrey Okoshkin
Add check of the resolved HEAD reference while printing of a commit summary.
resolve_ref_unsafe() may return NULL pointer if underlying calls of lstat() or
open() fail in files_read_raw_ref().
Such situation can be caused by race: file becomes inaccessible to this moment.
Signed-off-by: Andrey
18 matches
Mail list logo