Commit 155ee751143a98356ec72d9930d2a82ec750e466

Russell Belfer 2013-05-01T05:34:01

Add error messages for failed submodule lookup

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/submodule.c b/src/submodule.c
index 0a22e3b..f4fbcd3 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -128,6 +128,10 @@ int git_submodule_lookup(
 			git_buf_free(&path);
 		}
 
+		giterr_set(GITERR_SUBMODULE, (error == GIT_ENOTFOUND) ?
+			"No submodule named '%s'" :
+			"Submodule '%s' has not been added yet", name);
+
 		return error;
 	}