Commit 1022db2b6860d602e79169906eee4f299855975b

Vicent Marti 2013-05-02T17:42:09

refdb_fs: Traits are always surrounded by spaces This makes parsing easier! :p

diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 00d1c4f..6a6f589 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -219,9 +219,9 @@ static int packed_load(refdb_fs_backend *backend)
 			const char *traits = buffer_start + strlen(traits_header);
 			const char *traits_end = strchr(traits, '\n');
 
-			if (strstr(traits, "fully-peeled") != NULL) {
+			if (strstr(traits, " fully-peeled ") != NULL) {
 				backend->peeling_mode = PEELING_FULL;
-			} else if (strstr(traits, "peeled") != NULL) {
+			} else if (strstr(traits, " peeled ") != NULL) {
 				backend->peeling_mode = PEELING_STANDARD;
 			}
 
diff --git a/src/refs.h b/src/refs.h
index 927bc83..f487ee3 100644
--- a/src/refs.h
+++ b/src/refs.h
@@ -26,7 +26,7 @@
 
 #define GIT_SYMREF "ref: "
 #define GIT_PACKEDREFS_FILE "packed-refs"
-#define GIT_PACKEDREFS_HEADER "# pack-refs with: peeled fully-peeled"
+#define GIT_PACKEDREFS_HEADER "# pack-refs with: peeled fully-peeled "
 #define GIT_PACKEDREFS_FILE_MODE 0666
 
 #define GIT_HEAD_FILE "HEAD"