According to strbuf.h, strbuf_detach is the sole supported method
to unwrap a memory buffer from its strbuf shell.
So we should not return the pointer of strbuf.buf directly.
What's more, some memory leakages are solved.
---
path.c | 15 ++-
1 file changed, 10 insertions(+), 5 deleti
According to strbuf.h, strbuf_detach is the sole supported method
to unwrap a memory buffer from its strbuf shell.
So we should not return the pointer of strbuf.buf directly.
What's more, some memory leakages are solved.
---
path.c | 15 ++-
1 file changed, 10 insertions(+), 5 deleti
According to strbuf.h, strbuf_detach is the sole supported method
to unwrap a memory buffer from its strbuf shell.
So we should not return the pointer of strbuf.buf directly.
What's more, some memory leakages are solved.
---
path.c | 15 ++-
1 file changed, 10 insertions(+), 5 deleti
t0301 now tests git-credential-cache support for XDG user-specific
runtime path. Specifically:
* if $XDG_RUNTIME_DIR exists, use socket at
`$XDG_RUNTIME_DIR/git/credential-cache.sock`.
* otherwise, `/tmp/git-$uid/credential-cache.sock` is taken.
Helped-by: Jeff King
Signed-off-by: Hui Yiqun
move .git-credential-cache/socket to xdg_runtime_dir("credential-cache.sock")
Signed-off-by: Hui Yiqun
---
credential-cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/credential-cache.c b/credential-cache.c
index f4afdc6..40d838b 100644
--- a/credential-cac
$XDG_RUNTIME_DIR
/tmp/whatever # instead of empty
[1] https://specifications.freedesktop.org/basedir-spec
/basedir-spec-latest.html
Helped-by: Jeff King
Signed-off-by: Hui Yiqun
---
t/test-lib.sh | 10 ++
1 file changed, 10 insertions(+)
diff --git a/t/test-lib.sh b/t/test-lib.sh
-spec/basedir-spec-latest.html
Signed-off-by: Hui Yiqun
---
cache.h | 23 +++
path.c | 56
2 files changed, 79 insertions(+)
diff --git a/cache.h b/cache.h
index ef843c1..f8b649b 100644
--- a/cache.h
+++ b/cache.h
There were already `mkpath`, `mkpathdup` and `mksnpath` for build
filename, but lacked a version of `strbuf_` just like `strbuf_git_path`.
It is convenient to build a path and manipulate the result later with
strbuf.
Signed-off-by: Hui Yiqun
---
cache.h | 2 ++
path.c | 21
g the returned string.
Signed-off-by: Hui Yiqun
---
cache.h | 23 +++
path.c | 56
2 files changed, 79 insertions(+)
diff --git a/cache.h b/cache.h
index ef843c1..f8b649b 100644
--- a/cache.h
+++ b/cache.h
@@ -1001,6 +10
Common logic of mkpath() and mkpathdup() are collected into a
new do_mkpath(). Then, based on do_mkpath(), strbuf_mkpath() is
implemented.
Signed-off-by: Hui Yiqun
---
cache.h | 2 ++
path.c | 21 +
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/cache.h b
-by: Hui Yiqun
---
t/t0301-credential-cache.sh | 27 +++
1 file changed, 27 insertions(+)
diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh
index 82c8411..892d1ba 100755
--- a/t/t0301-credential-cache.sh
+++ b/t/t0301-credential-cache.sh
@@ -12,7
move .git-credential-cache/socket to xdg_runtime_dir("credential-cache.sock")
Signed-off-by: Hui Yiqun
---
credential-cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/credential-cache.c b/credential-cache.c
index f4afdc6..40d838b 100644
--- a/credential-cac
g the returned string.
Signed-off-by: Hui Yiqun
---
cache.h | 23 +++
path.c | 59 +++
2 files changed, 82 insertions(+)
diff --git a/cache.h b/cache.h
index b829410..e640a54 100644
--- a/cache.h
+++ b/cache.h
@@ -999,6 +9
move .git-credential-cache/socket to xdg_runtime_dir("credential-cache.sock")
Signed-off-by: Hui Yiqun
---
credential-cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/credential-cache.c b/credential-cache.c
index f4afdc6..40d838b 100644
--- a/credential-cac
-by: Hui Yiqun
---
t/t0301-credential-cache.sh | 25 +
1 file changed, 25 insertions(+)
diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh
index 82c8411..0718bb0 100755
--- a/t/t0301-credential-cache.sh
+++ b/t/t0301-credential-cache.sh
@@ -12,7 +12,32
15 matches
Mail list logo