Commit 6ac724afbe0b1244f84b9acc5dc8be0646be5ce3

Russell Belfer 2012-12-18T15:12:06

Clear error to avoid leaving invalid error behind

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/attr.c b/src/attr.c
index 95d63be..1b41441 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -572,8 +572,10 @@ static int collect_attr_files(
 		error = git_futils_find_system_file(&dir, GIT_ATTR_FILE_SYSTEM);
 		if (!error)
 			error = push_attr_file(repo, files, NULL, dir.ptr);
-		else if (error == GIT_ENOTFOUND)
+		else if (error == GIT_ENOTFOUND) {
+			giterr_clear();
 			error = 0;
+		}
 	}
 
  cleanup: