summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-09-14 13:33:49 -0700
committerVicent Martí <vicent@github.com>2012-09-14 13:33:49 -0700
commit70341b096329a37116c802dd53bdcec1bd2280f5 (patch)
tree9718dc09130564f00aabd509eccced2325806fec /src
parentb200a813c090c2ccf12ee4b5a99b45300fead2e8 (diff)
parentc2948c7754b8bd8059d2a5252ea419c937bbb1ca (diff)
downloadlibgit2-70341b096329a37116c802dd53bdcec1bd2280f5.tar.gz
Merge pull request #937 from nulltoken/fix/issue_936
refs: prevent locked refs from being enumerated
Diffstat (limited to 'src')
-rw-r--r--src/refs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/refs.c b/src/refs.c
index cdf3cb96e..74c40e850 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -494,6 +494,10 @@ static int _dirent_loose_listall(void *_data, git_buf *full_path)
return 0; /* we are filtering out this reference */
}
+ /* Locked references aren't returned */
+ if (!git__suffixcmp(file_path, GIT_FILELOCK_EXTENSION))
+ return 0;
+
if (data->callback(file_path, data->callback_payload))
data->callback_error = GIT_EUSER;