Skip to content

Commit

Permalink
credential-store: avoid assertion
Browse files Browse the repository at this point in the history
As of 1a9d15d (tempfile: a new module for handling temporary files,
2015-08-10), the temporary files which are used by the lock file
machinery adjust the permissions, and to do that, the config is read,
which in turn requires the config to be read.

This means that the runtime prefix needs to be resolved properly, but we
did not set that correctly in credential-store.

The symptom of this bug: when running

	printf '%s\n%s\n%s\n%s\n' \
		'protocol=https' 'host=gitblub.com' \
		'username=hello' 'password=world' |
	git credential-store store

an assertion is thrown:

	Assertion failed!

	Program: ...\libexec\git-core\git-credential-store.exe
	File: exec_cmd.c, Line 23

	Expression: argv0_path

	This application has requested the Runtime to terminate it in an
	unusual way.  Please contact the application's support team for
	more information.

This fixes #766

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jun 29, 2016
1 parent 5359b48 commit ac008b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions credential-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "credential.h"
#include "string-list.h"
#include "parse-options.h"
#include "exec_cmd.h"

static struct lock_file credential_lock;

Expand Down Expand Up @@ -160,6 +161,7 @@ int main(int argc, char **argv)

umask(077);

git_extract_argv0_path(argv[0]);
argc = parse_options(argc, (const char **)argv, NULL, options, usage, 0);
if (argc != 1)
usage_with_options(usage, options);
Expand Down

0 comments on commit ac008b3

Please sign in to comment.