summaryrefslogtreecommitdiff
path: root/src/attr.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-05-07 13:30:27 -0700
committerRussell Belfer <rb@github.com>2012-05-07 13:32:30 -0700
commitcba285d32ff25a9244a8d33a5e2b1129020376b8 (patch)
tree0074de9156580a482f3abd769bba2594d929ed2a /src/attr.c
parentdf0c89534d48ef38f1f1461ce1eff969983f43c8 (diff)
downloadlibgit2-cba285d32ff25a9244a8d33a5e2b1129020376b8.tar.gz
Fix directory finding for attrs
The fix to support attrs on bare repos went a little too far in trying to avoid using the working directory and ended up not processing the input path quite correctly.
Diffstat (limited to 'src/attr.c')
-rw-r--r--src/attr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/attr.c b/src/attr.c
index b7ac6355d..616cec6ff 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -450,11 +450,11 @@ static int collect_attr_files(
git_vector_init(files, 4, NULL) < 0)
return -1;
- /* given a unrooted path in a non-bare repo, resolve it */
- if (workdir && git_path_root(path) < 0)
+ /* Resolve path in a non-bare repo */
+ if (workdir != NULL)
error = git_path_find_dir(&dir, path, workdir);
else
- error = git_buf_sets(&dir, path);
+ error = git_path_dirname_r(&dir, path);
if (error < 0)
goto cleanup;