Commit 61ccba0d5630eee7f88d34c872b71777df124c70

Carlos Martín Nieto 2015-03-11T16:13:31

Merge pull request #2969 from adrienthebo/remote_add_invalid_refspec refspec: report errors when parsing an invalid refspec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/refspec.c b/src/refspec.c
index a56c44c..ad81412 100644
--- a/src/refspec.c
+++ b/src/refspec.c
@@ -133,6 +133,9 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
 	return 0;
 
  invalid:
+        giterr_set(
+                GITERR_INVALID,
+                "'%s' is not a valid refspec.", input);
 	return -1;
 }